FrameworkBenchmarks
FrameworkBenchmarks copied to clipboard
[C#][aspnetcore] - mark all classes sealed
That's a tiny improvement which might help for runtime to devirtualize class.
I would better quote Stephen Toub from this topic.
If the runtime can see that a given instance on which a virtual call is being made is actually sealed, then it knows for certain what the actual target of the call will be, and it can invoke that target directly rather than doing a virtual dispatch operation. Better yet, once the call is devirtualized, it might be inlineable, and then if it’s inlined, all the previously discussed benefits around optimizing the caller+callee combined kick in.