Skip to content

Speed up crossgen2 by a couple percent - #63234

Merged
MichalStrehovsky merged 1 commit into
dotnet:mainfrom
MichalStrehovsky:closestDefType
Dec 31, 2021
Merged

Speed up crossgen2 by a couple percent#63234
MichalStrehovsky merged 1 commit into
dotnet:mainfrom
MichalStrehovsky:closestDefType

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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

@MichalStrehovsky
MichalStrehovsky merged commit 58663f7 into dotnet:mainDec 31, 2021
@MichalStrehovsky
MichalStrehovsky deleted the closestDefType branch December 31, 2021 21:21
@ghostghost locked as resolved and limited conversation to collaborators Jan 31, 2022
@EgorBo

EgorBo commented Sep 8, 2022

Copy link
Copy Markdown
Member

@MichalStrehovsky btw, more like by 40% 😄
image

@MichalStrehovsky

Copy link
Copy Markdown
MemberAuthor

@MichalStrehovsky btw, more like by 40% 😄

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

Sign up for freeto 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

@MichalStrehovsky@EgorBo@jkotas