Skip to content

bench: Generate random acceses in Wasm for builtin benchmark - #14281

Merged
fitzgen merged 1 commit into
bytecodealliance:mainfrom
adamrk:abk/random-access-builtin-benchmark
Sep 5, 2026
Merged

fitzgen merged 1 commit into
bytecodealliance:mainfrom
adamrk:abk/random-access-builtin-benchmark

Conversation

@adamrk

@adamrk adamrk commented Sep 4, 2026

Copy link
Copy Markdown
Member

Use a basic multiplicative congruence generator
(https://en.wikipedia.org/wiki/Linear_congruential_generator) to generate a sequence of random buffer accesses within Wasm for the compile time builtins benchmark. This amoritizes the overhead of calling into Wasm while still generating random accesses.

My results are:

increment-random-byte-in-buf/concurrency_support=true/compile-time-builtins-host-buf-api
                        time:   [9.6652 ns 10.259 ns 10.891 ns]

Use a basic multiplicative congruence generator
(https://en.wikipedia.org/wiki/Linear_congruential_generator) to
generate a sequence of random buffer accesses within Wasm for the
compile time builtins benchmark. This amoritizes the overhead of calling
into Wasm while still generating random accesses.
@adamrk
adamrk requested a review from a team as a code owner September 4, 2026 20:30
@adamrk
adamrk requested review from alexcrichton and removed request for a team September 4, 2026 20:30

@fitzgen fitzgen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@fitzgen
fitzgen added this pull request to the merge queue Sep 5, 2026
Merged via the queue into bytecodealliance:main with commit 4675ee1 Sep 5, 2026
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants