BLAKE3 JS implementation is slower than in Chrome
Categories
(Core :: JavaScript Engine: JIT, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox159 | --- | fixed |
People
(Reporter: jandem, Assigned: iain)
References
()
Details
Attachments
(1 file, 3 external files)
|
45.35 KB,
text/plain
|
Details |
This was posted on Bluesky.
https://bsky.app/profile/ianopolous.bsky.social/post/3mvv2odg4hc2p
https://peergos.github.io/blake3-speed/
On my Mac we get ~800 MiB/s and Chrome 1080 MiB/s so the gap is a bit smaller.
Strangely enough, Safari is way slower, not sure if that's a problem with my machine.
Comment 1•2 months ago
|
||
On Windows arm64 on Firefox 158 vs Chrome Canary I get 667 vs 1053
| Reporter | ||
Comment 2•2 months ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #0)
Strangely enough, Safari is way slower, not sure if that's a problem with my machine.
People get 15-20 MiB/s with Safari 26. It seems to be fixed in Safari 27.
Comment 3•2 months ago
|
||
profile: https://share.firefox.dev/3V7Xugr
| Reporter | ||
Comment 4•2 months ago
|
||
Here's a JS shell version.
Claude analyzed our generated Ion code and it thinks the main issue is that we're not using rotate instructions for certain bitwise operations in the JS code.
Updated•2 months ago
|
| Assignee | ||
Comment 5•2 months ago
|
||
Updated•2 months ago
|
| Assignee | ||
Comment 6•2 months ago
|
||
This code was added in this commit while backing out a patch. However, looking at D59340, the original comment + setGuard() were on MWasmResultBase, not MRotate. It seems like there was some sort of undetected merge failure. I don't see any reason that this node has to be a guard.
| Assignee | ||
Comment 7•2 months ago
|
||
Comment 8•2 months ago
•
|
||
This stack's effect is significant!
x64 (Ryzen 9 9950X)
Before
best 5.57 ms median 5.58 ms => 718 MiB/s (best), 717 MiB/s (median)
After
best 3.75 ms median 3.76 ms => 1065 MiB/s (best), 1064 MiB/s (median)
Node.js 26.10.0
(with print = console.log)
best 2.89 ms median 3.37 ms => 1386 MiB/s (best), 1188 MiB/s (median)
loong64 (Loongson 3B6000 12C24T)
Before
best 23.39 ms median 23.41 ms => 171 MiB/s (best), 171 MiB/s (median)
After
best 13.17 ms median 13.17 ms => 304 MiB/s (best), 304 MiB/s (median)
Node.js 26.9.0
(with print = console.log)
best 9.88 ms median 9.89 ms => 405 MiB/s (best), 405 MiB/s (median)
| Assignee | ||
Comment 9•2 months ago
|
||
Yeah, those speedups look similar to what I was seeing locally.
Comment 10•1 month ago
|
||
Comment 11•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/4e9c07f4fdda
https://hg.mozilla.org/mozilla-central/rev/7c0d1b3a0eaa
https://hg.mozilla.org/mozilla-central/rev/cda1b525e3dd
Updated•1 month ago
|
Description
•