Skip to content

[release/8.0-staging] Improve the hash function used in the InstMethodHashTable #95285

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

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Nov 27, 2023

Backport of #94938 to release/8.0-staging

/cc @davidwrighton

Customer Impact

This dramatically improves the performance of compiling async functions in an application which has an extreme number of assemblies which are very similarly structured. See issue #94936.

This is not a regression.

Testing

Manual testing of affected scenario + standard broad CI testing

Risk

Low. This only changes a hash function, to include more entropy, and it does so in a way which touches less memory, so it should also be faster as well.

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

  • If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.

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
@ghost ghost added the area-VM-coreclr label Nov 27, 2023
@davidwrighton davidwrighton added the Servicing-consider Issue for next servicing release review label Nov 27, 2023
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

approved. we will take for consideration in 8.0.x

@JulieLeeMSFT JulieLeeMSFT added this to the 8.0.x milestone Dec 12, 2023
@JulieLeeMSFT JulieLeeMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Dec 13, 2023
@JulieLeeMSFT
Copy link
Member

CC @carlossanlop.

@akoeplinger akoeplinger modified the milestones: 8.0.x, 8.0.2 Dec 18, 2023
@jeffschwMSFT jeffschwMSFT merged commit 947da18 into release/8.0-staging Jan 2, 2024
@jkotas jkotas deleted the backport/pr-94938-to-release/8.0-staging branch January 2, 2024 17:27
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-VM-coreclr Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants