Benchmarks
How long the hashes take, measured on one machine on 2 December 2026. Every figure is for one core of that machine.
The machine and the method
- Crate
- legit-hashes 0.2.0, release build, Rust 1.100.1; files opened with
image0.25.10 (zune-jpeg0.5.15,png0.18.1) - Processor
- Intel Xeon Gold 5412U (2.1 GHz, AVX-512), a virtual machine allowed 2 cores, 8 GiB of memory
- Date
- 2 December 2026
- Method
- One file at a time, its bytes already in memory, so no disk and no network is timed. Each figure is the middle of three separate runs.
- Pictures
- JPEG files in three sizes: 120 small (0.11 megapixels each), 60 medium (1.5) and 12 large (23)
Every figure here is for one core of that machine. Yours will differ; the shape should not. No figure means more than its first two digits. The rows are in the same file as the evaluation's.
Where the time goes
One pass opens a file once and takes three hashes from it: pdq-v1, blockhash-v1 and perceptual-v1. For a small picture, opening the file costs as much as any hash. For a large one, pdq-v1 is two thirds of the work.
Small, 0.11 megapixels: 2.4 ms in all
Medium, 1.5 megapixels: 48 ms in all
Large, 23 megapixels: 1,565 ms in all
| Step | Small, 0.11 MP | Medium, 1.5 MP | Large, 23 MP |
|---|---|---|---|
| Open the file, to grey | 0.66 | 7.1 | 264 |
| Open the file, to colour | 0.80 | 10 | 317 |
average-v1 | 0.07 | 0.89 | 13 |
difference-v1 | 0.07 | 0.83 | 13 |
perceptual-v1 | 0.09 | 0.84 | 13 |
blockhash-v1 | 0.63 | 10 | 168 |
pdq-v1 | 0.79 | 28 | 1,035 |
| One pass, all of it | 2.4 | 48 | 1,565 |
| Pictures a second, one pass | 421 | 21 | 0.64 |
By the pixel
Dividing by size shows what each step costs however big the picture is. The three 64-bit hashes run at about the speed of reading the pixels. pdq-v1 slows as pictures grow, because it blurs the whole picture and a large one no longer fits the processor's cache.
| Step | Small | Medium | Large |
|---|---|---|---|
| Open the file, to grey | 171 | 210 | 87 |
| Open the file, to colour | 140 | 143 | 73 |
average-v1 | 1,639 | 1,680 | 1,732 |
difference-v1 | 1,597 | 1,816 | 1,811 |
perceptual-v1 | 1,234 | 1,777 | 1,759 |
blockhash-v1 | 179 | 146 | 136 |
pdq-v1 | 142 | 54 | 22 |
Shrinking a large picture to 512 pixels first and hashing that took 113 ms where pdq-v1 on the full picture took 1,035. It also changes the hash: the evaluation says by how much.
More than one worker
| Pictures | 1 worker | 2 workers | 4 workers | Memory at peak, each worker |
|---|---|---|---|---|
| Small | 377 | 731 | 737 | 6 MiB |
| Medium | 20 | 38 | 39 | 27 MiB |
| Large | 0.64 | 1.2 | 1.2 | 425 MiB |
Two workers did 1.86 to 1.94 times the work of one. Four did no more than two, because the machine has two cores. Nothing was measured past two cores, so this page says nothing about sixteen. A worker needs about 14 bytes of memory for each pixel of the largest picture it opens.
Text
| Length | simhash-v1, by words |
simhash-v1, by runs of 5 characters |
minhash-legacy-v1, by runs of 5 characters |
|---|---|---|---|
| 50 characters | 1,641,558 | 412,049 | 128,240 |
| 300 characters | 272,660 | 19,164 | 20,140 |
| 2,000 characters | 16,750 | 2,248 | 2,981 |
The MinHash column is the older definition, minhash-legacy-v1: the run was made before minhash-v1 took its present form, and that one has not been timed yet.
What this does not show
- Any other processor. There is no measurement on Arm, and none on a desktop or laptop chip.
- More than two cores.
- Reading files from disk or over a network, which in a real job often costs more than hashing.
- PNG files, which open more slowly than JPEG; their rows are in the data file.
- The whole-number path
pdq-v1takes on processors without standard floating point. Measured on this machine it was 43 times slower on small pictures and 16 times on medium ones.
The square beside the crate's name is simhash-v1:9e25ed03add95299, the hash of this page's opening sentence, computed by the crate as the page was served. Each page here has its own.