Skip to Content

Benchmarks

What does the ORM layer cost? These benchmarks run the same operations on the same Neo4j data through the raw neo4j-driver with hand-written Cypher (the baseline), the Cyphra typed client, neogma, and, for GraphQL, @neo4j/graphql against @cyphra/graphql. The scripts are in bench/ and run with one command against a Neo4j in Docker.

What the published run shows (numbers below, from the run dated in Environment):

  • Most operations are one statement. A create (nested creates and connects included), update, upsert, a delete with onDelete cascades, and the reads compile to a single Cypher statement that also returns the result, so on Bolt Cyphra is within about 20% of hand-written Cypher on every scenario: update +2%, nested create of a user with 5 posts +11% (it used to send 12 statements and cost 4× the baseline), create +16%, cascading delete +17%. Reads stay within about 10%; differences of that size are noise on this machine.
  • Shortest path is +13% (re-run on its own after the rest of the suite, same machine and method). Cyphra’s statement does about the same work in Neo4j as the hand-written one; on the client, decoding the typed path no longer re-reads the schema for every node or builds nodes it throws away, and DateTime values are converted without neo4j-driver’s text round trip. The +47% of the first run was mostly noise on this machine.
  • Over HTTP, an operation is one request. A single statement that writes nothing when it fails goes out as one auto-commit Query API request, like the fetch baseline, so Cyphra over HTTP is within about 20% of it (it was 1.2× to 9× before).
  • @cyphra/graphql is faster than @neo4j/graphql on 8 of the 9 shared operations (by 18% to 32% on the median, 2% on findMany), and level on the aggregation.
  • neogma is often faster than the raw baseline on simple operations, because it uses auto-commit transactions (see Caveats), but it has no API for half of the scenarios.

Single-digit percentages are within the noise of this run: compare the p95 column before reading much into them.

Typed clients over Bolt

Median latency of one call, with the p95 under it, one call in flight. The overhead compares medians with the raw driver.

Scenarioneo4j-driverCyphraCyphra vs driverneogmaneogma vs driver
findUnique by id0.81 msp95 1.26 ms0.86 msp95 1.30 ms+5%0.57 msp95 1.04 ms−30%
findMany, filter + order + limit 504.54 msp95 7.40 ms4.91 msp95 7.29 ms+8%3.88 msp95 5.64 ms−15%
Nested read, 2 levels2.76 msp95 4.08 ms2.77 msp95 4.02 ms0%3.82 msp95 6.05 ms+38%
create1.30 msp95 1.95 ms1.51 msp95 2.38 ms+16%0.99 msp95 1.58 ms−24%
Nested create (user + 5 posts)1.43 msp95 2.15 ms1.59 msp95 2.60 ms+11%1.22 msp95 2.04 ms−15%
upsert0.88 msp95 1.26 ms0.96 msp95 1.38 ms+9%n/an/a
update by unique0.86 msp95 1.20 ms0.88 msp95 1.34 ms+2%0.64 msp95 0.87 ms−26%
delete with cascade1.51 msp95 3.31 ms1.76 msp95 3.64 ms+17%n/an/a
Relation count1.68 msp95 5.32 ms1.56 msp95 3.25 ms−7%n/an/a
aggregate6.91 msp95 8.11 ms6.90 msp95 7.86 ms0%n/an/a
groupBy8.68 msp95 9.78 ms8.69 msp95 9.27 ms0%n/an/a
3-hop traversal4.55 msp95 6.38 ms4.83 msp95 6.42 ms+6%n/an/a
Shortest path1.11 msp95 1.75 ms1.25 msp95 2.24 ms+13%n/an/a
Vector findSimilar (k = 10)1.53 msp95 3.14 ms1.69 msp95 3.66 ms+10%n/an/a
−50%−25%driver+25%+50%findUnique by id+5%−30%findMany, filter + order + limit 50+8%−15%Nested read, 2 levels0%+38%create+16%−24%Nested create (user + 5 posts)+11%−15%upsert+9%update by unique+2%−26%delete with cascade+17%Relation count−7%aggregate0%groupBy0%3-hop traversal+6%Shortest path+13%Vector findSimilar (k = 10)+10%
Median latency against the raw driver running hand-written Cypher (the vertical line). Left of it is faster, right is slower. Bars past +50% are cut.

HTTP transport

Cyphra’s HTTP transport (the Neo4j Query API over fetch, for edge runtimes) against the same hand-written Cypher sent to the Query API with fetch, and against the Bolt baseline.

ScenarioQuery API (fetch)Cyphra HTTPvs fetchvs Bolt driver
findUnique by id1.99 msp95 3.69 ms1.94 msp95 2.80 ms−3%+138%
findMany, filter + order + limit 505.25 msp95 6.70 ms5.42 msp95 7.88 ms+3%+19%
Nested read, 2 levels3.34 msp95 4.52 ms4.05 msp95 5.76 ms+21%+47%
create2.48 msp95 3.54 ms2.75 msp95 3.81 ms+11%+112%
Nested create (user + 5 posts)2.48 msp95 3.72 ms3.02 msp95 4.24 ms+22%+111%
upsert1.73 msp95 4.06 ms1.95 msp95 2.89 ms+12%+121%
update by unique1.62 msp95 2.21 ms1.75 msp95 2.69 ms+8%+104%
delete with cascade2.54 msp95 5.50 ms2.89 msp95 6.32 ms+14%+91%
Relation count2.25 msp95 7.27 ms2.31 msp95 4.54 ms+2%+38%
aggregate7.35 msp95 9.20 ms7.48 msp95 8.20 ms+2%+8%
groupBy9.12 msp95 10.3 ms9.29 msp95 10.3 ms+2%+7%
3-hop traversal4.10 msp95 11.8 ms4.58 msp95 11.5 ms+12%+1%
Shortest path2.78 msp95 4.61 ms3.19 msp95 5.74 ms+15%+188%
Vector findSimilar (k = 10)3.99 msp95 12.8 ms4.79 msp95 18.2 ms+20%+213%

An operation that compiles to one statement and writes nothing when it fails (every scenario here) is one auto-commit request, the same as the fetch baseline: the difference is the work on the client. Operations that need an explicit transaction (a nested connect, checked after the statement ran, or anything inside $transaction) add one request to commit.

GraphQL

@cyphra/graphql and @neo4j/graphql 7.6.8 serve the same type definitions on the same driver. Each operation is parsed and validated once, then run with execute(), as a server with a document cache would.

Scenarioneo4j-driver@neo4j/graphql@cyphra/graphql@cyphra vs @neo4j
findUnique by id0.81 msp95 1.26 ms1.35 msp95 2.52 ms0.91 msp95 1.34 ms−32%
findMany, filter + order + limit 504.54 msp95 7.40 ms5.58 msp95 7.89 ms5.47 msp95 7.59 ms−2%
Nested read, 2 levels2.76 msp95 4.08 ms4.30 msp95 6.16 ms3.52 msp95 5.57 ms−18%
create1.30 msp95 1.95 ms2.31 msp95 3.30 ms1.73 msp95 2.53 ms−25%
Nested create (user + 5 posts)1.43 msp95 2.15 ms2.66 msp95 3.68 ms1.97 msp95 3.07 ms−26%
update by unique0.86 msp95 1.20 ms1.53 msp95 2.06 ms1.08 msp95 1.62 ms−29%
delete with cascade1.51 msp95 3.31 ms1.98 msp95 3.30 ms1.54 msp95 3.04 ms−22%
Relation count1.68 msp95 5.32 ms2.55 msp95 5.02 ms1.87 msp95 3.29 ms−27%
aggregate6.91 msp95 8.11 ms11.4 msp95 14.4 ms12.0 msp95 13.6 ms+5%

Both libraries compile each GraphQL operation to one Cypher statement, so the difference is the time spent building that statement and shaping the result. @cyphra/graphql is level on the aggregation (it reads the same nodes) and ahead elsewhere.

Not compared

A library without an API for a scenario is left out of it: writing raw Cypher through it would only measure the driver again.

  • upsert, neogma: no upsert (createOne with merge MERGEs on every property)
  • upsert, GraphQL libraries: no upsert mutation in @neo4j/graphql
  • delete with cascade, neogma: no cascading delete (detach only)
  • Relation count, neogma: no relation count API
  • aggregate, neogma: no aggregation API
  • groupBy, neogma: no aggregation API
  • groupBy, GraphQL libraries: no groupBy in @neo4j/graphql
  • 3-hop traversal, neogma: findRelationships returns one row per path, not distinct nodes
  • 3-hop traversal, GraphQL libraries: no traversal without a custom @cypher field
  • Shortest path, neogma: no path API
  • Shortest path, GraphQL libraries: no path API without @cypher
  • Vector findSimilar (k = 10), neogma: no vector search API
  • Vector findSimilar (k = 10), GraphQL libraries: not compared (vector support differs)

Method

  • Data. 10,000 users following 5 others each (50,000 edges), 10,000 posts by the first 2,000 users, 2 comments per post, and 1,000 documents with 384-dimension embeddings, seeded with a fixed random seed. Constraints and indexes are the ones cyphra push creates from the benchmark schema: unique ids and emails, a range index on User.age, a cosine vector index.
  • Same conditions. Every Bolt contender uses neo4j-driver 6.3.2 with default settings and the explicit database neo4j. Cyphra, the GraphQL libraries and the baseline share one driver; neogma always creates its own, from the same version. Every contender walks the same inputs in the same order.
  • Same answers. Before timing, the first result of each contender is compared with the baseline’s (rows, counts, ids), and writes are checked in the database (5 posts after the nested create, nothing left after the cascading delete).
  • Timing. tinybench  6, chosen over mitata because these are asynchronous I/O-bound calls (where mitata’s CPU-level counters do not apply) and the delete scenario needs an unmeasured beforeEach. Each scenario runs 3 interleaved rounds; in each, every contender warms up, then runs at least 70 iterations and 1 second. The order rotates between rounds and the samples are merged, so noise on the machine spreads over all contenders.
  • The baseline opens a session per call and runs one statement in a managed transaction (executeRead / executeWrite, which retry transient errors), as Cyphra does, and maps records to plain objects (integers to numbers, temporals to Date).

Caveats

  • Loopback, one machine. Neo4j runs in Docker next to the benchmark, so there is no network latency: the best case for showing client-side overhead. Over a network, each call gains the round-trip time and the relative overhead gets smaller.
  • A shared machine. Other processes ran during the published run. Interleaving spreads that noise; it does not remove it. Differences of a few percent are within the noise, and the p95 shows the spread.
  • No disk flush. The database runs on a tmpfs, so commits do not wait for the transaction log to reach a disk (on a shared machine that wait is large and erratic). On real storage each write gains that time, the same for every library, and the relative write overhead gets smaller.
  • Transaction patterns differ. neogma runs reads and single writes as auto-commit statements (session.run), one round trip less than a managed transaction, without retries; that, rather than less work, is why it can beat the baseline on simple reads.
  • Sequential calls only. Throughput under concurrency is not measured.
  • A small, cached data set. The graph fits in memory, so the numbers show the client side (building the query, parameters, mapping results) and the statement each library sends, not Neo4j’s disk.

Environment

Captured automatically by the run (the Neo4j data directory is a tmpfs):

Run
2026-11-22, commit 285efd4
CPU
Intel(R) Xeon(R) CPU E3-1270 v3 @ 3.50GHz, 8 logical cores
Memory
23 GB
OS
Debian GNU/Linux 13 (trixie) (Linux 7.2.6+deb13-amd64), x64
Runtime
Node.js v24.21.0
Database
Neo4j 5.26.33 community in Docker on the same machine (loopback), data on tmpfs
Libraries
neo4j-driver 6.3.2, cyphra 0.14.0, @cyphra/graphql 0.14.0, @neo4j/graphql 7.6.8, neogma 2.0.5, graphql 16.15.0
Data
10,000 users, 50,000 follows, 10,000 posts, 20,000 comments, 1,000 docs
Timing
tinybench 6.2.4; 3 interleaved rounds, each with 10 warm-up iterations then at least 70 iterations and 1 s per contender

All numbers

Mean with its 95% margin of error; ops/s is 1000 / mean, one call in flight.

ScenarioContendermedianp95meanops/ssamples
findUnique by idneo4j-driver0.81 ms1.26 ms0.90 ms ±2.0%1,1123338
findUnique by idCyphra0.86 ms1.30 ms0.93 ms ±1.4%1,0723221
findUnique by idneogma0.57 ms1.04 ms0.64 ms ±1.4%1,5574674
findUnique by id@neo4j/graphql1.35 ms2.52 ms1.52 ms ±1.7%6601981
findUnique by id@cyphra/graphql0.91 ms1.34 ms0.98 ms ±1.2%1,0213064
findUnique by idQuery API (fetch)1.99 ms3.69 ms2.29 ms ±2.3%4371313
findUnique by idCyphra HTTP1.94 ms2.80 ms2.05 ms ±1.3%4891467
findMany, filter + order + limit 50neo4j-driver4.54 ms7.40 ms4.96 ms ±2.1%202606
findMany, filter + order + limit 50Cyphra4.91 ms7.29 ms5.16 ms ±1.7%194584
findMany, filter + order + limit 50neogma3.88 ms5.64 ms4.07 ms ±1.5%246738
findMany, filter + order + limit 50@neo4j/graphql5.58 ms7.89 ms5.98 ms ±2.4%167503
findMany, filter + order + limit 50@cyphra/graphql5.47 ms7.59 ms5.74 ms ±1.5%174524
findMany, filter + order + limit 50Query API (fetch)5.25 ms6.70 ms5.39 ms ±1.2%186558
findMany, filter + order + limit 50Cyphra HTTP5.42 ms7.88 ms5.81 ms ±2.0%172517
Nested read, 2 levelsneo4j-driver2.76 ms4.08 ms2.96 ms ±1.9%3371014
Nested read, 2 levelsCyphra2.77 ms4.02 ms2.96 ms ±1.8%3371014
Nested read, 2 levelsneogma3.82 ms6.05 ms4.24 ms ±3.7%236709
Nested read, 2 levels@neo4j/graphql4.30 ms6.16 ms4.56 ms ±1.8%220661
Nested read, 2 levels@cyphra/graphql3.52 ms5.57 ms3.79 ms ±1.9%264794
Nested read, 2 levelsQuery API (fetch)3.34 ms4.52 ms3.51 ms ±1.8%285856
Nested read, 2 levelsCyphra HTTP4.05 ms5.76 ms4.35 ms ±2.3%230692
createneo4j-driver1.30 ms1.95 ms1.42 ms ±2.9%7052118
createCyphra1.51 ms2.38 ms1.62 ms ±1.8%6181854
createneogma0.99 ms1.58 ms1.08 ms ±2.8%9292788
create@neo4j/graphql2.31 ms3.30 ms2.46 ms ±2.1%4061219
create@cyphra/graphql1.73 ms2.53 ms1.82 ms ±4.3%5491650
createQuery API (fetch)2.48 ms3.54 ms2.61 ms ±1.5%3841152
createCyphra HTTP2.75 ms3.81 ms2.87 ms ±1.2%3481046
Nested create (user + 5 posts)neo4j-driver1.43 ms2.15 ms1.56 ms ±2.4%6421926
Nested create (user + 5 posts)Cyphra1.59 ms2.60 ms1.75 ms ±3.3%5701712
Nested create (user + 5 posts)neogma1.22 ms2.04 ms1.41 ms ±4.2%7102132
Nested create (user + 5 posts)@neo4j/graphql2.66 ms3.68 ms2.83 ms ±2.7%3541063
Nested create (user + 5 posts)@cyphra/graphql1.97 ms3.07 ms2.15 ms ±2.1%4651397
Nested create (user + 5 posts)Query API (fetch)2.48 ms3.72 ms2.91 ms ±13.5%3441031
Nested create (user + 5 posts)Cyphra HTTP3.02 ms4.24 ms3.23 ms ±1.5%310931
upsertneo4j-driver0.88 ms1.26 ms0.95 ms ±1.4%1,0553167
upsertCyphra0.96 ms1.38 ms1.04 ms ±1.6%9612886
upsertQuery API (fetch)1.73 ms4.06 ms2.04 ms ±2.3%4901472
upsertCyphra HTTP1.95 ms2.89 ms2.11 ms ±1.5%4741423
update by uniqueneo4j-driver0.86 ms1.20 ms0.93 ms ±2.0%1,0713214
update by uniqueCyphra0.88 ms1.34 ms0.95 ms ±1.3%1,0523159
update by uniqueneogma0.64 ms0.87 ms0.68 ms ±1.1%1,4774433
update by unique@neo4j/graphql1.53 ms2.06 ms1.59 ms ±1.0%6301892
update by unique@cyphra/graphql1.08 ms1.62 ms1.15 ms ±1.1%8662600
update by uniqueQuery API (fetch)1.62 ms2.21 ms1.70 ms ±1.0%5901771
update by uniqueCyphra HTTP1.75 ms2.69 ms1.93 ms ±2.0%5181556
delete with cascadeneo4j-driver1.51 ms3.31 ms1.78 ms ±2.2%5621688
delete with cascadeCyphra1.76 ms3.64 ms2.03 ms ±2.2%4921477
delete with cascade@neo4j/graphql1.98 ms3.30 ms2.18 ms ±1.5%4591378
delete with cascade@cyphra/graphql1.54 ms3.04 ms1.80 ms ±2.3%5571673
delete with cascadeQuery API (fetch)2.54 ms5.50 ms2.98 ms ±2.6%3351007
delete with cascadeCyphra HTTP2.89 ms6.32 ms3.38 ms ±2.7%296891
Relation countneo4j-driver1.68 ms5.32 ms2.18 ms ±3.2%4601382
Relation countCyphra1.56 ms3.25 ms1.79 ms ±2.0%5591678
Relation count@neo4j/graphql2.55 ms5.02 ms2.93 ms ±2.1%3411024
Relation count@cyphra/graphql1.87 ms3.29 ms2.09 ms ±1.7%4781435
Relation countQuery API (fetch)2.25 ms7.27 ms2.90 ms ±3.3%3451039
Relation countCyphra HTTP2.31 ms4.54 ms2.67 ms ±2.5%3751129
aggregateneo4j-driver6.91 ms8.11 ms7.11 ms ±1.2%141424
aggregateCyphra6.90 ms7.86 ms7.18 ms ±1.8%139419
aggregate@neo4j/graphql11.4 ms14.4 ms11.9 ms ±2.0%84253
aggregate@cyphra/graphql12.0 ms13.6 ms12.3 ms ±0.9%81246
aggregateQuery API (fetch)7.35 ms9.20 ms7.64 ms ±1.5%131394
aggregateCyphra HTTP7.48 ms8.20 ms7.61 ms ±0.9%131396
groupByneo4j-driver8.68 ms9.78 ms8.86 ms ±1.0%113341
groupByCyphra8.69 ms9.27 ms8.81 ms ±1.0%114342
groupByQuery API (fetch)9.12 ms10.3 ms9.33 ms ±1.2%107323
groupByCyphra HTTP9.29 ms10.3 ms9.44 ms ±0.9%106319
3-hop traversalneo4j-driver4.55 ms6.38 ms4.79 ms ±1.3%209628
3-hop traversalCyphra4.83 ms6.42 ms5.00 ms ±0.9%200601
3-hop traversalQuery API (fetch)4.10 ms11.8 ms5.28 ms ±4.3%190571
3-hop traversalCyphra HTTP4.58 ms11.5 ms5.51 ms ±4.0%182547
Shortest pathneo4j-driver1.11 ms1.75 ms1.20 ms ±1.4%8362510
Shortest pathCyphra1.25 ms2.24 ms1.36 ms ±1.7%7332199
Shortest pathQuery API (fetch)2.78 ms4.61 ms3.07 ms ±2.5%326979
Shortest pathCyphra HTTP3.19 ms5.74 ms3.45 ms ±2.3%290870
Vector findSimilar (k = 10)neo4j-driver1.53 ms3.14 ms1.85 ms ±5.0%5401621
Vector findSimilar (k = 10)Cyphra1.69 ms3.66 ms1.95 ms ±2.3%5121538
Vector findSimilar (k = 10)Query API (fetch)3.99 ms12.8 ms5.83 ms ±5.1%171515
Vector findSimilar (k = 10)Cyphra HTTP4.79 ms18.2 ms6.39 ms ±5.4%156472

Run it yourself: start a disposable Neo4j 5 with APOC in Docker, then pnpm bench from the repository root. The bench README  has the commands, the scenarios and the source of every contender.

More