Skip to content
Back to Benchmarks

Benchmark Family

Searching

Deterministic lookup benchmarks for exact search, bound queries, and hash lookup baselines.

Generated

Apr 28, 2026, 12:07 PM

Measured

1,395

Skipped

465

Failures

0

Algorithms

10

Profiles / targets

6 / 7

How to Read These Results

Benchmarks measure specific local JavaScript implementations on deterministic inputs. Results depend on runtime, hardware, implementation details, and input shape. They are not universal algorithm rankings.

Sorted-input algorithms skip unsupported fixtures, and hash lookup is a data-structure baseline rather than a direct ordered-array comparison.

Contextual results

Algorithms Tested

Readable implementations included in this run

Linear Search

Linear / First Index

Scans left to right and returns the first matching index or -1.

Binary Search

Ordered / Exact Index

Classic ordered-array binary search; returns any matching index or -1.

Lower Bound

Bound / Lower Bound Index

Returns the first index whose value is greater than or equal to the target.

Upper Bound

Bound / Upper Bound Index

Returns the first index whose value is greater than the target.

Jump Search

Ordered / Exact Index

Jumps by sqrt(n) blocks in sorted input, then scans within the candidate block.

Exponential Search

Ordered / Exact Index

Expands an ordered range exponentially, then binary-searches the bounded interval.

Interpolation Search

Distribution / Exact Index

Sorted numeric search using position interpolation; safest on roughly uniform distributions.

Ternary-Style Ordered Search

Ordered / Exact Index

Ordered-array exact search that splits the search interval into thirds; not unimodal optimization ternary search.

Hash Lookup (Prebuilt)

Data Structure / Boolean Lookup

Set.has lookup with the Set built outside the timed lookup; data-structure baseline.

Hash Lookup (Build + Query)

Data Structure / Boolean Lookup

Builds a Set from the input and performs one lookup inside the timed run.

Input profiles

Fixture coverage in this family

Random UnsortedSorted UniformSorted DenseSorted SparseSorted Many DuplicatesNearly Sorted

Target patterns

Fixture coverage in this family

Present FrontPresent MiddlePresent EndMissing LowMissing HighMissing BetweenDuplicate Target

Summary Findings

Careful takeaways from the generated benchmark data

  • Batched per-query timing is used so very fast lookup operations remain measurable.
  • Lower-bound and upper-bound entries validate bound semantics, not exact-match semantics.
  • Hash lookup baselines are separated because prebuilt lookup and build-plus-query have different cost models.

Hash Lookup Baselines

Data-structure baselines are shown separately from ordered-array search algorithms.

AlgorithmMeasuredAvg rankMedianFastestSkipped
Hash Lookup (Prebuilt)186111860
Hash Lookup (Build + Query)1862200

Ordered-Array Search Summary

Aggregate ranks for ordered-search algorithms across compatible sorted fixtures.

AlgorithmMeasuredAvg rankMedianFastestSkipped
Interpolation Search931.25818293
Ternary-Style Ordered Search1242.76621262
Exponential Search1244.20251962
Binary Search1244.3954262
Lower Bound1244.8875062
Linear Search1864.937690
Jump Search1244.9355162
Upper Bound1244.9765162

Mixed Workload Preview

Selected mixed-target workload cells using batched per-query timing.

ProfileSizeAlgorithmMedian us/query
Nearly Sorted1,000Hash Lookup (Prebuilt)0.009
Nearly Sorted10,000Hash Lookup (Prebuilt)0.009
Nearly Sorted100,000Hash Lookup (Prebuilt)0.008
Random Unsorted1,000Hash Lookup (Prebuilt)0.009
Random Unsorted10,000Hash Lookup (Prebuilt)0.008
Random Unsorted100,000Hash Lookup (Prebuilt)0.009
Sorted Dense1,000Hash Lookup (Prebuilt)0.008
Sorted Dense10,000Interpolation Search0.008

Interpretation notes

Context for interpreting this family

  • Single-process JavaScript timing can be affected by garbage collection, JIT behavior, and system load.
  • Per-query timing is estimated from batched measured runs.
  • Hash lookup baselines have different cost models from ordered array search.
  • Lower-bound and upper-bound validate bound semantics, not exact-match semantics.
  • No memory profiling or browser-runtime comparison is included.

Outputs

Generated benchmark artifacts used by this public page

searching-baseline.jsonsearching-baseline-summary.jsonsearching-baseline.mdsearching-baseline.csv

Limitations

Scope boundaries for this benchmark family

  • Single-process JavaScript timing can be affected by garbage collection, JIT behavior, and system load.
  • Per-query timing is estimated from batched measured runs.
  • Hash lookup baselines have different cost models from ordered array search.
  • Lower-bound and upper-bound validate bound semantics, not exact-match semantics.
  • No memory profiling or browser-runtime comparison is included.