Stream: git-wasmtime

Topic: wasmtime / PR #15202 wasmtime: replace hasher NopHasher w...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 08 2026 at 19:28):

MythicByte opened PR #15202 from MythicByte:issue-15133 to bytecodealliance:main:

replace a custom implementation of a hasher with the same hashbrown uses.

Check

It uses the same libary but a other algorithmen, i think for wasmtime fits this algorithmen better with the deterministic.

Benefit

The new hashing algorithmen is 11 times faster.

Tracking issue: 15133

view this post on Zulip Wasmtime GitHub notifications bot (Nov 08 2026 at 19:28):

MythicByte removed the review request for wasmtime-core-reviewers from PR #15202.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 08 2026 at 19:28):

MythicByte requested alexcrichton for a review on PR #15202.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 08 2026 at 19:28):

MythicByte requested wasmtime-core-reviewers for a review on PR #15202.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 08 2026 at 19:28):

MythicByte requested wasmtime-default-reviewers for a review on PR #15202.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 08 2026 at 19:29):

MythicByte edited PR #15202:

replace a custom implementation of a hasher with the same hashbrown uses.

Check

It uses the same libary but a other algorithmen, i think for wasmtime fits this algorithmen better with the deterministic.

Benefit

The new hashing algorithmen is 11 times faster.

Tracking issue: #15133

view this post on Zulip Wasmtime GitHub notifications bot (Nov 08 2026 at 19:30):

MythicByte edited PR #15202:

replace a custom implementation of a hasher with the same hashbrown uses.

Check

It uses the same libary but a other algorithmen, i think for wasmtime fits the hashing algorithmen better which is deterministic.

Benefit

The new hashing algorithmen is 11 times faster.

Tracking issue: #15133

view this post on Zulip Wasmtime GitHub notifications bot (Nov 08 2026 at 21:44):

github-actions[bot] added the label wasmtime:api on PR #15202.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 08 2026 at 21:44):

github-actions[bot] added the label wasmtime:ref-types on PR #15202.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 08 2026 at 23:44):

github-actions[bot] commented on PR #15202:

Subscribe to Label Action

cc @fitzgen

<details>
This issue or pull request has been labeled: "wasmtime:api", "wasmtime:ref-types"

Thus the following users have been cc'd because of the following labels:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2026 at 14:13):

:memo: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2026 at 14:13):

:speech_balloon: alexcrichton created PR review comment:

Have you perhaps benchmarked this without specifying any custom hasher here for your workload at all?

Additionally, with a more official hasher, could you explore changing the u64 here to (VMSharedTypeIndex, VMSharedTypeIndex)?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 20:12):

:memo: MythicByte submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 20:12):

:speech_balloon: MythicByte created PR review comment:

I have tried (VMSharedTypeIndex, VMSharedTypeIndex) and it performs a bit worse like _0.1 ns_, i don't now if it for maintenance better this would be your decision. I would say go to default std hashmap to eliminate maintenance burden, the margin efficient increase are not worth it ?

Key Map Hasher Mean
u64 hashbrown::HashMap default 2.037 ns
u64 hashbrown::HashMap Foldhash FixedState 1.930 ns
u64 hashbrown::HashMap std::RandomState 10.815 ns
u64 hashbrown::HashMap old NopHasher 118.232 ns
u64 std::collections::HashMap default (RandomState) 10.802 ns
u64 std::collections::HashMap Foldhash FixedState 1.930 ns
u64 std::collections::HashMap old NopHasher 120.446 ns
(VMSharedTypeIndex, VMSharedTypeIndex) hashbrown::HashMap default 1.824 ns
(VMSharedTypeIndex, VMSharedTypeIndex) hashbrown::HashMap Foldhash FixedState 1.758 ns
(VMSharedTypeIndex, VMSharedTypeIndex) hashbrown::HashMap std::RandomState 11.169 ns
(VMSharedTypeIndex, VMSharedTypeIndex) std::collections::HashMap default (RandomState) 11.104 ns
(VMSharedTypeIndex, VMSharedTypeIndex) std::collections::HashMap Foldhash FixedState 1.766 ns

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 20:30):

MythicByte updated PR #15202.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 12 2026 at 15:23):

:memo: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 12 2026 at 15:23):

:speech_balloon: alexcrichton created PR review comment:

Thanks for collecting that! For 0.1ns changes that's pretty much noise, so for ergonomics can this PR also switch to the tuple? As for the default-vs-not, I think it'd be reasonable to use FixedState here or the default RandomState, up to you.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 12 2026 at 15:53):

MythicByte updated PR #15202.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 12 2026 at 15:55):

:memo: MythicByte submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 12 2026 at 15:55):

:speech_balloon: MythicByte created PR review comment:

tuple switch is complete and the hasher remains with default. I think the performance gain is not worth the extra dependence.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 12 2026 at 16:39):

:thumbs_up: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 12 2026 at 16:39):

alexcrichton added PR #15202 wasmtime: replace hasher NopHasher with foldhash Fixedstate to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 12 2026 at 17:01):

:check: alexcrichton merged PR #15202.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 12 2026 at 17:01):

alexcrichton removed PR #15202 wasmtime: replace hasher NopHasher with foldhash Fixedstate from the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 12 2026 at 19:51):

fitzgen commented on PR #15202:

This doubled the instructions retired on hoot-earley-boyer and +61% instructions retired on dart-deltablue: https://github.com/bytecodealliance/wasmtime/issues/15248

I think we want to revert this change and investigate another approach.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 12 2026 at 20:06):

alexcrichton commented on PR #15202:

posted a revert as https://github.com/bytecodealliance/wasmtime/pull/15251, but @MythicByte please feel free to resubmit after investigating

view this post on Zulip Wasmtime GitHub notifications bot (Nov 12 2026 at 21:17):

MythicByte commented on PR #15202:

Thanks @fitzgen for pointing the problem out. The fix is in #15255


Last updated: Nov 19 2026 at 20:05 UTC