bagger-js
bagger-js copied to clipboard
Benchmark hash implementations
Currently we're using asmCrypto.js which has reasonable performance but we should compare with a WebAssembly implementation. Since Rust has an official WASM backend it should be relatively easy to use the SHA-2 crate and create a function which does exactly what we need (bytes -> hex) for benchmarking.
The WASM toolchain offers some interesting performance benefits but it definitely adds complexity:
https://github.com/LibraryOfCongress/bagger-js/pull/48/commits/e273bdeb4bc21e4124007e9a87baf0ad3d1591c0
https://github.com/acdha/wasm-hashing/commit/673e09b2c6454bf9425e0350a0a071ce19a524ce