ZBSearch

ZBSearch vs Orama

Head-to-head performance benchmarks comparing ZBSearch and Orama on the same workloads.

ZBSearch is a fork of Orama maintained by the original engineering team. The API is compatible, but the internals have been optimized. This page summarizes benchmark results from the benchmarks/ suite in this repository.

Test environment

Results below were collected on July 9, 2026 using Orama 3.1.18 and ZBSearch 3.2.1, run via Benny. Higher ops/s is better. Percentages show how much slower the loser is relative to the winner in each suite.

Summary

AreaVerdict
Full-text searchZBSearch is 14–61% faster on search; indexing is effectively equal
FacetsZBSearch is 30–59% faster across all facet scenarios
Vector searchZBSearch is 12–56% faster on flat indexes; IVF pushes gains to ~225–508% over Orama
Geosearch (BKD)ZBSearch is up to ~8,700% faster on radius queries at 500m
Sorted indexes (AVL)ZBSearch is faster on most AVL operations (insert, find, range search)
Persistence sizeIdentical serialized size for the same dataset

Dataset: 1,512 video-game records with title, description, rating, and genres fields. Search benchmarks run against a database populated once before timing; insert benchmarks create a fresh database on each iteration.

BenchmarkOrama 3.1.18ZBSearch 3.2.1Difference
Plain search2,696 ops/s4,055 ops/sZBSearch 33.5% faster
Search with filters29,992 ops/s35,014 ops/sZBSearch 14.3% faster
Long text + complex filters5,976 ops/s15,219 ops/sZBSearch 60.7% faster

ZBSearch is faster across all search scenarios tested here, with the largest gap on long-text queries with complex filters. Indexing throughput is effectively identical between the two engines.

Facets

BenchmarkOrama 3.1.18ZBSearch 3.2.1Difference
Search with facets10,205 ops/s14,477 ops/sZBSearch 29.5% faster
Facets (all documents)2,982 ops/s5,285 ops/sZBSearch 43.6% faster
Facets + filters4,947 ops/s8,976 ops/sZBSearch 44.9% faster
Facets + long text + filters4,977 ops/s12,130 ops/sZBSearch 59.0% faster

Dataset: 2,000 documents, 128-dimensional vectors.

BenchmarkOrama 3.1.18ZBSearch 3.2.1 (flat)Difference
Vector search2,351 ops/s2,850 ops/sZBSearch 17.5% faster
Strict similarity4,864 ops/s7,558 ops/sZBSearch 35.6% faster
Vector + filters5,800 ops/s6,538 ops/sZBSearch 11.3% faster
Vector + facets1,398 ops/s2,075 ops/sZBSearch 32.6% faster

ZBSearch IVF vs Orama flat

ZBSearch adds an optional IVF index for approximate nearest-neighbor search. Orama does not ship an equivalent in the JS core.

BenchmarkOrama 3.1.18 (flat)ZBSearch 3.2.1 (flat)ZBSearch 3.2.1 (IVF)
Vector search2,359 ops/s2,933 ops/s14,335 ops/s
Strict similarity4,624 ops/s7,014 ops/s19,258 ops/s
Vector + filters5,946 ops/s6,664 ops/s19,301 ops/s

With IVF (nlist=179, nprobe=16), ZBSearch vector search is ~225–508% faster than Orama's flat index on this dataset.

Geosearch (BKD tree)

Dataset: 10,000 geopoints.

BenchmarkOrama 3.1.18ZBSearch 3.2.1Difference
Insert319 ops/s324 ops/sZBSearch 1.5% faster
Search by radius (500m)4,359 ops/s384,158 ops/sZBSearch 98.9% faster
Search by radius (5km)3,613 ops/s5,710 ops/sZBSearch 36.7% faster
Search by radius sorted (5km)697 ops/s1,756 ops/sZBSearch 60.3% faster
Search by polygon3,942 ops/s4,321 ops/sZBSearch 8.8% faster
Contains (10k lookups)1,042 ops/s1,041 ops/s~equal

The largest geosearch gain is on tight-radius queries, where ZBSearch's BKD implementation avoids scanning the full point set.

Sorted indexes (AVL tree)

Dataset: 10,000 numeric keys.

BenchmarkOrama 3.1.18ZBSearch 3.2.1Difference
Insert485 ops/s640 ops/sZBSearch 24.2% faster
Insert batched (1k threshold)520 ops/s689 ops/sZBSearch 24.5% faster
Find (10k lookups)3,028 ops/s4,322 ops/sZBSearch 29.9% faster
Contains (10k lookups)2,324 ops/s5,376 ops/sZBSearch 56.8% faster
Range search (narrow)30,022 ops/s62,238 ops/sZBSearch 51.8% faster
Range search (wide)6,357 ops/s7,010 ops/sZBSearch 9.3% faster
Greater than7,898 ops/s7,884 ops/s~equal
Less than7,922 ops/s7,948 ops/s~equal
Remove (5k keys)491 ops/s558 ops/sZBSearch 12.0% faster

Persistence size

Serializing the same indexed dataset produces identical on-disk size:

EngineJSONGZIP
Orama 3.1.185,997,650 bytes1,425,774 bytes
ZBSearch 3.2.15,997,650 bytes1,425,774 bytes

Run the benchmarks yourself

From the repository root, build ZBSearch first, then run any suite in benchmarks/:

cd packages/zbsearch && npm run build
cd ../../benchmarks && npm install

npm run benchmark              # core insert/search
npm run benchmark:facets       # facet workloads
npm run benchmark:vector         # vector search (flat)
npm run benchmark:vector-ivf     # vector flat vs IVF
npm run benchmark:bkd            # geosearch BKD tree
npm run benchmark:avl            # sorted AVL tree
npm run benchmark:bundle-size    # serialized DB size

Results are saved as JSON and HTML charts under benchmarks/benchmark/results/.

On this page