noncrypto-hash-kt benchmarks
Speed and memory use of each hash function, on every Kotlin Multiplatform target, measured on the machine described below.
Speed
Memory
Bytes retained by one digest in its initial state. Lower is better.
All results
Show the table of every measurement
Methodology
- Each target runs a program compiled for release (JVM, JS and Wasm on Node.js, Kotlin/Native), one target at a time.
- Each measurement warms up while calibrating a batch size, then times several batches. The figure shown is the median batch; the table also reports the fastest and slowest.
- Inputs change at every iteration, and every hash is accumulated into a value printed at the end, so no work can be optimized away.
- One-shot workloads use
HashFunction.hashLong; Long, reused digest resets and reuses one streaming digest. - 1000 objects, structured hashes, with
HashFunction.hashValueLong, a list shaped like the path of an aggregate program (as in Collektive): 500 identifier-like strings of 10 to 100 characters and 500 primitives, mostly small indices, shuffled. Its size is the number of bytes absorbed by the structured encoding, including type tags and lengths. - Allocations per operation come from the JVM thread allocation counter; other runtimes do not expose one.
- Digest footprints come from the allocation counter on the JVM (exact), and from the heap size after garbage collection elsewhere (approximate, averaged over 100,000 digests). WASI exposes no memory statistics.
- On JavaScript,
Longis emulated, so 64-bit algorithms are expected to be slow there.