Re:Faster TypedArrays: Vector Addition in WebAssembly
by twoodfin on Sunday January 02, 2022 @01:01PM
(#29771466)
Iād be interested to see if the manual loop unrolling is necessary, or if the WASM toolchain would perform that optimization automatically if `len` were a known constant.
[ Parent
| on HN ]
Re:Faster TypedArrays: Vector Addition in WebAssembly
by brrrrrm on Sunday January 02, 2022 @01:39PM
(#29771990)
That's a good question, and I think there's some data in the benchmark dump to help answer it.
The tuning logic for the results labeled `wasmblr (tuned X)` sweeps through a couple values for X (the unroll size) and shows the best one. On some browsers (and in node.js) this value goes to 1, which means unrolling isn't found to be necessary for that size.
Mostly, from what I've seen, it tunes to a value greater than 1. So I think generally it's still necessary today.