Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seal more internal/private classes #160

Merged
merged 7 commits into from
Mar 28, 2024

Conversation

PaulusParssinen
Copy link
Contributor

@PaulusParssinen PaulusParssinen commented Mar 27, 2024

This PR enables per CA1852 and CA1813 as suggestions. We can also alternatively enable entire performance category analyzers. I went through some of the internal and private types and sealed them, unsealing them later is easy as is it is not a breaking change.

You can read more about potential benefits by sealing internal/private classes by default here: dotnet/runtime#49944

note: skimming through usage of the classes I sealed, the benefits sealing are negligible at best as very few is stored in arrays (we would avoid covariance checks) or having virtual call dispatches.. However the concrete attributes should benefit from sealing and I think it's good pratice to seal any private or internal class with no-derived types by default as unsealing it later is free.

@TedHartMS TedHartMS assigned TedHartMS and unassigned TedHartMS Mar 27, 2024
@badrishc
Copy link
Contributor

Amazing stuff! You are on a roll :).

@vazois vazois merged commit 6b18b73 into microsoft:main Mar 28, 2024
20 checks passed
@PaulusParssinen PaulusParssinen deleted the more-devirtualization branch March 28, 2024 03:36
@github-actions github-actions bot locked and limited conversation to collaborators May 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants