Skip to content

Speed up crossgen2 by a couple percent #63234

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

Merged
merged 1 commit into from
Dec 31, 2021

Conversation

MichalStrehovsky
Copy link
Member

I ran crossgen2 compiling a Release CoreLib under a profiler and this stood out quite a bit. The JIT-based CoreLib doesn't have the Array<T> type so GetType was walking all types in CoreLib.

image

I split this logic out to an ILC-specific file. I don't remember this showing up in the profiles for ILC, but I added a cache nevertheless.

I ran crossgen2 compiling a Release CoreLib under a profiler and this stood out quite a bit. The JIT-based CoreLib doesn't have the `Array<T>` type so `GetType` was walking all types in CoreLib.

I split this logic out to an ILC-specific file. I don't remember this showing up in the profiles for ILC, but I added a cache nevertheless.
@MichalStrehovsky
Copy link
Member Author

@dotnet/crossgen-contrib could someone have a look please?

@MichalStrehovsky MichalStrehovsky merged commit 58663f7 into dotnet:main Dec 31, 2021
@MichalStrehovsky MichalStrehovsky deleted the closestDefType branch December 31, 2021 21:21
@ghost ghost locked as resolved and limited conversation to collaborators Jan 31, 2022
@EgorBo
Copy link
Member

EgorBo commented Sep 8, 2022

@MichalStrehovsky btw, more like by 40% 😄
image

@MichalStrehovsky
Copy link
Member Author

@MichalStrehovsky btw, more like by 40% 😄

Nice! I didn't bother to measure. I was guessing 10% based on the profile.

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