hash-wasm icon indicating copy to clipboard operation
hash-wasm copied to clipboard

blake3 SIMD version

Open vans163 opened this issue 3 years ago • 4 comments

So there is this sightglass version but it deviates a lot due to clang being used here, many errors.

https://github.com/bytecodealliance/sightglass/blob/main/benchmarks/blake3-simd/Dockerfile

vans163 avatar Dec 11 '22 03:12 vans163

I don't understand. What is the issue?

Daninet avatar Dec 11 '22 13:12 Daninet

The issue is a feature request to get SIMD version of blake3 ported+compiled, it seems the bindings emcc creates are not compatible with the JSON loading way hash-wasm does, im not even sure how to produce a .wasm compatible with the loader using emcc.

Testing the sightglass benchmarks I am also not sure what to make of them, but if I interpreted it right, the SIMD version is only 10% faster.

vans163 avatar Dec 11 '22 16:12 vans163

I also measured it with some other hashing algorithms and I got similar results: SIMD only provided about 10% improvement in performance, which is not worth the effort + extra bundle size in my opinion. SIMD builds would require duplicated WASM binaries for each crypto algorithm to keep supporting browsers without SIMD.

Daninet avatar Dec 11 '22 17:12 Daninet

I also measured it with some other hashing algorithms and I got similar results: SIMD only provided about 10% improvement in performance, which is not worth the effort + extra bundle size in my opinion. SIMD builds would require duplicated WASM binaries for each crypto algorithm to keep supporting browsers without SIMD.

I was hoping 50%+ speedup with the other optimizations too (except tailcalls). Also it seems only Safari is behind on SIMD support ATM out of generally used browsers.

vans163 avatar Dec 11 '22 22:12 vans163