LedgerMath
← All benchmarksHow hash works

Hash 64 bytes

hash · compared across machine types · 24 Series on 8 machine types · AWS us-east-2

CPU
Algorithm
Order
CompareMachineVariantP50P99RateUnit costRuns
c8a.2xlarge58.80 ns—1.089 GB/s$0.00000703 /1M ops89
c8i.2xlarge76.69 ns—834.5 MB/s$0.00000798 /1M ops89
c8g.2xlarge88.00 ns—727.3 MB/s$0.00000774 /1M ops4
c6i.8xlarge101.1 ns—632.7 MB/s$0.0000382 /1M ops89
i4i.2xlarge101.2 ns—632.6 MB/s$0.0000193 /1M ops89
m6id.2xlarge101.2 ns—632.5 MB/s$0.0000133 /1M ops1
i4g.2xlarge112.2 ns—570.3 MB/s$0.0000193 /1M ops4
m5.large571.4 ns—112.0 MB/s$0.0000152 /1M ops91
Compared:m5.largec8g.2xlargec8i.2xlarge

Run-to-run spread

time per hash across counted Runs

Over time

newest counted Runs, time per hash

(one request each to the data API)

What this measures

How long one thread takes to hash an input of a given size, from 64 bytes to 100 MiB, with CRC32C, with SipHash-1-3 under a fixed key (the variant Rust's DefaultHasher uses), or with SHA-256, using the processor's CRC and SHA instructions when it has them.

What it does not measure

  • Every repetition hashes the same input, which the program fills in before measuring (byte i holds i mod 256).
  • For 64 bytes no repetition uses the result of the one before: the figure is the time per hash of hashes computed back to back, which the processor may overlap, not a measurement of one hash on its own.
  • crc32 is one dependent chain of crc32 instructions, not the interleaved or carry-less-multiply forms that libraries such as zlib-ng, ISA-L or the Linux kernel use on long inputs, which run several times faster on the same processor.

The whole method, on its page →

c8i.2xlarge · sha256

Beat this hot path on GitHub ↗