Skip to content

Improve the hash function used in the InstMethodHashTable #94938

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
Nov 18, 2023

Conversation

davidwrighton
Copy link
Member

Instead of using the TypeDef token of the MethodTable, use the TypeHandle pointer instead. This is both faster to compute, and is more unique, as the TypeDef token could be shared across multiple types in different assemblies, and if the type is generic itself, it could be shared across multiple different instantiations of the type.

Improves the benchmark mentioned in isseu #94936 such that the cost is about 24 seconds, and the time in spent is spent almost entirely in the JIT, as should be expected.

Fixes #94936

Instead of using the TypeDef token of the MethodTable, use the TypeHandle pointer instead. This is both faster to compute, and is more unique, as the TypeDef token could be shared across multiple types in different assemblies, and if the type is generic itself, it could be shared across multiple different instantiations of the type.

Improves the benchmark mentioned in isseu dotnet#94936 such that the cost is about 24 seconds, and the time in spent is spent almost entirely in the JIT, as should be expected.

Fixes dotnet#94936
@davidwrighton
Copy link
Member Author

Failing test is #94931

@davidwrighton davidwrighton merged commit 8a1b985 into dotnet:main Nov 18, 2023
@davidwrighton
Copy link
Member Author

/backport to release/8.0-staging

Copy link
Contributor

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/7009409824

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.

Async methods become slower to compile in applications which have a very large number of assemblies
3 participants