Skip to content

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

@github-actions
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