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 image 0.25.10 (zune-jpeg 0.5.15, png 0.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

Open the file 0.80 ms pdq-v1 0.79 ms blockhash-v1 0.63 ms Colour to grey 0.09 ms perceptual-v1 0.09 ms

Medium, 1.5 megapixels: 48 ms in all

Open the file 10 ms pdq-v1 28 ms blockhash-v1 10 ms Colour to grey 1.2 ms perceptual-v1 0.84 ms

Large, 23 megapixels: 1,565 ms in all

Open the file 317 ms pdq-v1 1,035 ms blockhash-v1 168 ms Colour to grey 26 ms perceptual-v1 13 ms
Milliseconds for one picture, one core. Each drawing has its own scale: its longest bar is its slowest step.
Milliseconds for one picture, one core
Step Small, 0.11 MP Medium, 1.5 MP Large, 23 MP
Open the file, to grey0.667.1264
Open the file, to colour0.8010317
average-v10.070.8913
difference-v10.070.8313
perceptual-v10.090.8413
blockhash-v10.6310168
pdq-v10.79281,035
One pass, all of it2.4481,565
Pictures a second, one pass421210.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.

Megapixels a second, one core
Step Small Medium Large
Open the file, to grey17121087
Open the file, to colour14014373
average-v11,6391,6801,732
difference-v11,5971,8161,811
perceptual-v11,2341,7771,759
blockhash-v1179146136
pdq-v11425422

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 a second for one pass, on two cores
Pictures 1 worker 2 workers 4 workers Memory at peak, each worker
Small3777317376 MiB
Medium20383927 MiB
Large0.641.21.2425 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

Texts a second, one core
Length simhash-v1, by words simhash-v1, by runs of 5 characters minhash-legacy-v1, by runs of 5 characters
50 characters1,641,558412,049128,240
300 characters272,66019,16420,140
2,000 characters16,7502,2482,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

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.