Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

[C#][aspnetcore] - mark all classes sealed - #7403

Closed
unsafePtr wants to merge 2 commits into
TechEmpower:masterfrom
unsafePtr:aspcore-mark-classes-sealed
Closed

[C#][aspnetcore] - mark all classes sealed#7403
unsafePtr wants to merge 2 commits into
TechEmpower:masterfrom
unsafePtr:aspcore-mark-classes-sealed

Conversation

@unsafePtr

Copy link
Copy Markdown

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.

@NateBrady23

Copy link
Copy Markdown
Member

Closing this in favor of #7698 right now. Please ping the guys there to see if this is something they want to do.

@unsafePtr

Copy link
Copy Markdown
Author

Thank you Nate. I see the change is already in place

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants