ZIP code lookup benchmarks
These timings come from a single reference machine. Use the same inputs on your deployment hardware to estimate your own latency.
Reference run
Apple M5 Pro · darwin/arm64 · Node.js v22.16.0 · @bluehive/zipcodes 9.0.0 · 41,203 ZIP codes
Each operation gets one untimed warm-up batch, including construction of any search index. The table reports the median time per call across five timed batches in one Node.js process. Timings include the loop and reading the return value.
| Operation | Calls per batch | Time per call |
|---|---|---|
lookup('90210') | 1,000,000 | 34 ns |
distance(62959, 90210) | 1,000,000 | 43 ns |
lookupByName('New York', 'NY') | 100,000 | 124 ns |
lookupByState('CA') | 10,000 | 13.5 µs |
search('san') | 100,000 | 346 ns |
radius(95014, 50) | 2,000 | 182 µs |
lookupByCoords(40.715, -73.985) | 500 | 127 µs |
nearest(40.715, -73.985, 10) | 500 | 134 µs |
A fresh process loaded the CommonJS package in 31.8 ms on this run.
Reproduce the run
From a fresh clone of the repository, use the measured source revision and download the matching benchmark script. Run on an idle machine using the Node.js version above. The JSON report includes all five samples and SHA-256 hashes of the script, dataset and compiled entry point.
git checkout 509f7969b7145032f8498efe278b93d126776249
curl -fsSLo scripts/bench.mjs https://zipcodes.bluehive.com/benchmarks/harness.mjs
echo "9fdb55d856b969440a87277574bc1e673319cf59864d85bc167e78f19a1268db scripts/bench.mjs" | shasum -a 256 -c -
npm install
npm run build
node scripts/bench.mjs --json