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

[mono] Pre-compute and cache class name hashes #100847

Merged
merged 1 commit into from
Apr 10, 2024
Merged

Conversation

kg
Copy link
Member

@kg kg commented Apr 10, 2024

During startup we spend a measurable amount of time hashing types, and some of that time is spent hashing classnames over and over again. Pre-computing the hash at class creation time lets us easily optimize that out. ~0.56% -> ~0.36%

Copy link
Member

@steveisok steveisok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@lambdageek
Copy link
Member

This PR missed the one other place where we create a class and set the name: reflection_setup_internal_class_internal

matouskozak pushed a commit to matouskozak/runtime that referenced this pull request Apr 30, 2024
During startup we spend a measurable amount of time hashing types, and some of that time is spent hashing classnames over and over again, so this PR caches the hash at class creation time instead.
@github-actions github-actions bot locked and limited conversation to collaborators May 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants