GithubHelp home page GithubHelp logo

Comments (3)

AArnott avatar AArnott commented on May 26, 2024

I don't know why the methods that are attributed were attributed. Inlining already happens by the JIT automatically in cases where it is obvious to the JIT that it would provide a useful improvement. We should only add attributes where the JIT isn't already inlining it yet we've measured perf and found it to make it faster to add the attribute.
If you have that data, I'd take a PR that adds the attributes.

from messagepack-csharp.

nmi-relewise avatar nmi-relewise commented on May 26, 2024

The methods are getting called ~300M times, in green:

image

The timings differ 49 vs 34 sec:
image

It seem to be a possible way go forward; however I'd ask collective brain to look for pitfalls in da approach.

Thanks.

from messagepack-csharp.

nmi-relewise avatar nmi-relewise commented on May 26, 2024

The first challenge - how to measure accurately.
There are tier-ed compilations, therefore a point with JIT optimizations makes sense:

image

However, as you've mentioned, runtime to pick how/which calls to be inlined:

image

In case of .NET 7 the ReadInt32 method still gets a jmp (what is weird - with multiple different addresses).

Since we are effectively trying to measure the impact of 'extra' work on top of read int from span = super fast, any observation tools will introduce the noise = influence = explain why numbers are so different with dotTrace, and not that far in real life.

@AArnott

from messagepack-csharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.