Performance comparison between JS and WASM implementations.
import type { BenchmarkResult } from "@aspect/crypto-wasm";const result: BenchmarkResult = { operation: "hash-sha256", jsTimeMs: 120, wasmTimeMs: 45, speedup: 2.67,}; Copy
import type { BenchmarkResult } from "@aspect/crypto-wasm";const result: BenchmarkResult = { operation: "hash-sha256", jsTimeMs: 120, wasmTimeMs: 45, speedup: 2.67,};
The accelerated operation being benchmarked.
Execution time of the pure-JS implementation in milliseconds.
Execution time of the WASM implementation in milliseconds.
Ratio of JS time to WASM time (values above 1 mean WASM is faster).
Performance comparison between JS and WASM implementations.
Example