Skip to content
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

[mono] dn_simdhash_ght_compatible optimizations for ARM64 #113241

Closed
wants to merge 4 commits into from

Conversation

kg
Copy link
Member

@kg kg commented Mar 7, 2025

Depends on #113095.

The current version of dn_simdhash_ght_compatible has especially bad performance on arm64 vs x64, so I took some steps to redesign it and address some codegen deficiencies. This has the added benefit of making it a bit faster on x64 as well.

There weren't benchmarks for ght_compatible in the benchmark suite originally, so I added a couple. (I was benchmarking end-to-end originally, which makes it harder to compare across platforms.)

The other variants of simdhash should be unaffected, this was mostly a design defect in the ghashtable compatibility variant.

For the find_random_keys benchmark:
Improved from 109.7% to 76.84% on x64.
Improved from 121.17% to 82.22% on ARM64.

Before (x64):

ght_find_random_keys: Warmed 18 time(s). Running 8192 iterations... 14 step(s): avg 17.507ns min 12.824ns max 21.249ns
dnght_find_random_keys: Warmed 21 time(s). Running 8192 iterations... 13 step(s): avg 19.211ns min 18.790ns max 19.541ns
dn_find_random_keys: Warmed 31 time(s). Running 8192 iterations... 19 step(s): avg 13.353ns min 12.913ns max 13.980ns

After (x64):

ght_find_random_keys: Warmed 16 time(s). Running 4096 iterations... 23 step(s): avg 21.244ns min 13.822ns max 23.902ns
dnght_find_random_keys: Warmed 24 time(s). Running 8192 iterations... 15 step(s): avg 16.325ns min 15.494ns max 16.779ns
dn_find_random_keys: Warmed 30 time(s). Running 8192 iterations... 18 step(s): avg 13.687ns min 13.139ns max 13.834ns

Before (arm64):

ght_find_random_keys: Warmed 6 time(s). Running 2048 iterations... 15 step(s): avg 69.279ns min 67.222ns max 70.292ns
dnght_find_random_keys: Warmed 5 time(s). Running 2048 iterations... 12 step(s): avg 83.949ns min 83.271ns max 84.813ns
dn_find_random_keys: Warmed 6 time(s). Running 2048 iterations... 15 step(s): avg 69.026ns min 68.155ns max 69.770ns

After (arm64):

ght_find_random_keys: Warmed 7 time(s). Running 2048 iterations... 15 step(s): avg 65.820ns min 64.640ns max 69.091ns
dnght_find_random_keys: Warmed 8 time(s). Running 2048 iterations... 19 step(s): avg 54.118ns min 53.717ns max 54.888ns
dn_find_random_keys: Warmed 10 time(s). Running 4096 iterations... 13 step(s): avg 40.598ns min 40.352ns max 40.794ns

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Mar 7, 2025
@kg kg changed the title Simdhash inline ght equals [mono] dn_simdhash_ght_compatible optimizations for ARM64 Mar 7, 2025
kg added 4 commits March 6, 2025 20:28
…ms like sometimes they don't get inlined

Add some measurements for simdhash ght

Improve makefile

Introduce scan data that's fetched once per bucket

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…default

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Choose a reason for hiding this comment

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

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

@kg
Copy link
Member Author

kg commented Mar 11, 2025

Superceded by #113274

@kg kg closed this Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant