Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

kg
Copy link
Member

@kg kg commented Mar 8, 2025

This PR reverts the generic instance cache to use GHashTable and replaces the hash function for generic instances with a more robust hash function. The latter is mostly important for simdhash, but it should improve performance for GHashTable too.

This may address the increase in AOT compile times.

@ghost ghost added the area-VM-meta-mono label Mar 8, 2025
@kg
Copy link
Member Author

kg commented Mar 8, 2025

cc @steveisok @kotlarmilos

@kg kg changed the title [mono] Switch generic instance cache back to GHashTable [mono] Switch generic instance cache back to GHashTable; improve ginst hash function Mar 8, 2025
@kotlarmilos
Copy link
Member

kotlarmilos commented Mar 10, 2025

Total AOT compilation of the dedup assembly (build time) on macOS-arm64 host of MAUI template app in debug config:

  • Baseline (main): 247,423 ms
  • Target (this change): 47,805 ms

There are improvements in #113274 as well.

@kg kg marked this pull request as ready for review March 10, 2025 09:56
@Copilot Copilot AI review requested due to automatic review settings March 10, 2025 09:56
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

@kg
Copy link
Member Author

kg commented Mar 10, 2025

/backport to release/9.0-staging

Copy link
Contributor

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

steveisok pushed a commit that referenced this pull request Mar 10, 2025
…ashTable; improve ginst hash function (#113316)

Backport of #113287

This change will revert to the hashtable container used for the generic instance cache in .NET 8.0 to address a performance regression introduced by changing to a different container in 9. Also improves the hash function used for the cache (the existing one was suboptimal.)

Co-authored-by: Katelyn Gadd <[email protected]>
@kotlarmilos kotlarmilos self-requested a review March 13, 2025 10:26
@kg kg merged commit 64252fb into dotnet:main Apr 7, 2025
65 of 68 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 8, 2025
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.

2 participants