Giter Club home page Giter Club logo

Comments (2)

Chris3606 avatar Chris3606 commented on May 18, 2024 1

I have no formal documentation that states it specifically; just some experience with other projects where it appeared that there was some speed increase when the version of .NET being targeted was more specific. C# syntax is not entirely backwards compatible across multiple run-times (at least since the introduction of C# 8; there are features in C# 8 you cannot use when you target versions of runtimes prior to when it was introduced); so it is conceivable that the IL of the compiled library would change for different targets; so it is possible it could be optimized differently. Certainly it's something I recommend you benchmark for yourself for this particular case, if you attempt it at all.

Regardless, (and this may be better as a separate proposal, up to you); I do think it would be ideal if you targeted both .NET standard 2.0 and .NET Standard 1.0 explicitly, even if no other frameworks are targeted. The Microsoft guidance specifically recommends that you have an explicit .NET Standard 2.0 target in order to avoid bloating package graph when you must also target .NET Standard 1.x:

✔️ DO include a netstandard2.0 target if you require a netstandard1.x target.
All platforms supporting .NET Standard 2.0 will use the netstandard2.0 target and benefit from having a smaller package > graph while older platforms will still work and fall back to using the netstandard1.x target.

from high-speed-priority-queue-for-c-sharp.

BlueRaja avatar BlueRaja commented on May 18, 2024

targeting the runtimes specifically can, under some circumstances, enable the compiler to apply optimizations that only work for the particular version of .NET being targeted

Do you have a source for this? The C# compiler itself does almost no optimizations - nearly all of them are done by the JIT. It would be very surprising if the JIT were holding back optimizations simply because the code was compiled using an older version of .Net Standard.

from high-speed-priority-queue-for-c-sharp.

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.