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, adeletewithonDeletecascades, 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
DateTimevalues are converted withoutneo4j-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
fetchbaseline, so Cyphra over HTTP is within about 20% of it (it was 1.2× to 9× before). @cyphra/graphqlis faster than@neo4j/graphqlon 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.
| Scenario | neo4j-driver | Cyphra | Cyphra vs driver | neogma | neogma vs driver |
|---|---|---|---|---|---|
| findUnique by id | 0.81 msp95 1.26 ms | 0.86 msp95 1.30 ms | +5% | 0.57 msp95 1.04 ms | −30% |
| findMany, filter + order + limit 50 | 4.54 msp95 7.40 ms | 4.91 msp95 7.29 ms | +8% | 3.88 msp95 5.64 ms | −15% |
| Nested read, 2 levels | 2.76 msp95 4.08 ms | 2.77 msp95 4.02 ms | 0% | 3.82 msp95 6.05 ms | +38% |
| create | 1.30 msp95 1.95 ms | 1.51 msp95 2.38 ms | +16% | 0.99 msp95 1.58 ms | −24% |
| Nested create (user + 5 posts) | 1.43 msp95 2.15 ms | 1.59 msp95 2.60 ms | +11% | 1.22 msp95 2.04 ms | −15% |
| upsert | 0.88 msp95 1.26 ms | 0.96 msp95 1.38 ms | +9% | n/a | n/a |
| update by unique | 0.86 msp95 1.20 ms | 0.88 msp95 1.34 ms | +2% | 0.64 msp95 0.87 ms | −26% |
| delete with cascade | 1.51 msp95 3.31 ms | 1.76 msp95 3.64 ms | +17% | n/a | n/a |
| Relation count | 1.68 msp95 5.32 ms | 1.56 msp95 3.25 ms | −7% | n/a | n/a |
| aggregate | 6.91 msp95 8.11 ms | 6.90 msp95 7.86 ms | 0% | n/a | n/a |
| groupBy | 8.68 msp95 9.78 ms | 8.69 msp95 9.27 ms | 0% | n/a | n/a |
| 3-hop traversal | 4.55 msp95 6.38 ms | 4.83 msp95 6.42 ms | +6% | n/a | n/a |
| Shortest path | 1.11 msp95 1.75 ms | 1.25 msp95 2.24 ms | +13% | n/a | n/a |
| Vector findSimilar (k = 10) | 1.53 msp95 3.14 ms | 1.69 msp95 3.66 ms | +10% | n/a | n/a |
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.
| Scenario | Query API (fetch) | Cyphra HTTP | vs fetch | vs Bolt driver |
|---|---|---|---|---|
| findUnique by id | 1.99 msp95 3.69 ms | 1.94 msp95 2.80 ms | −3% | +138% |
| findMany, filter + order + limit 50 | 5.25 msp95 6.70 ms | 5.42 msp95 7.88 ms | +3% | +19% |
| Nested read, 2 levels | 3.34 msp95 4.52 ms | 4.05 msp95 5.76 ms | +21% | +47% |
| create | 2.48 msp95 3.54 ms | 2.75 msp95 3.81 ms | +11% | +112% |
| Nested create (user + 5 posts) | 2.48 msp95 3.72 ms | 3.02 msp95 4.24 ms | +22% | +111% |
| upsert | 1.73 msp95 4.06 ms | 1.95 msp95 2.89 ms | +12% | +121% |
| update by unique | 1.62 msp95 2.21 ms | 1.75 msp95 2.69 ms | +8% | +104% |
| delete with cascade | 2.54 msp95 5.50 ms | 2.89 msp95 6.32 ms | +14% | +91% |
| Relation count | 2.25 msp95 7.27 ms | 2.31 msp95 4.54 ms | +2% | +38% |
| aggregate | 7.35 msp95 9.20 ms | 7.48 msp95 8.20 ms | +2% | +8% |
| groupBy | 9.12 msp95 10.3 ms | 9.29 msp95 10.3 ms | +2% | +7% |
| 3-hop traversal | 4.10 msp95 11.8 ms | 4.58 msp95 11.5 ms | +12% | +1% |
| Shortest path | 2.78 msp95 4.61 ms | 3.19 msp95 5.74 ms | +15% | +188% |
| Vector findSimilar (k = 10) | 3.99 msp95 12.8 ms | 4.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.
| Scenario | neo4j-driver | @neo4j/graphql | @cyphra/graphql | @cyphra vs @neo4j |
|---|---|---|---|---|
| findUnique by id | 0.81 msp95 1.26 ms | 1.35 msp95 2.52 ms | 0.91 msp95 1.34 ms | −32% |
| findMany, filter + order + limit 50 | 4.54 msp95 7.40 ms | 5.58 msp95 7.89 ms | 5.47 msp95 7.59 ms | −2% |
| Nested read, 2 levels | 2.76 msp95 4.08 ms | 4.30 msp95 6.16 ms | 3.52 msp95 5.57 ms | −18% |
| create | 1.30 msp95 1.95 ms | 2.31 msp95 3.30 ms | 1.73 msp95 2.53 ms | −25% |
| Nested create (user + 5 posts) | 1.43 msp95 2.15 ms | 2.66 msp95 3.68 ms | 1.97 msp95 3.07 ms | −26% |
| update by unique | 0.86 msp95 1.20 ms | 1.53 msp95 2.06 ms | 1.08 msp95 1.62 ms | −29% |
| delete with cascade | 1.51 msp95 3.31 ms | 1.98 msp95 3.30 ms | 1.54 msp95 3.04 ms | −22% |
| Relation count | 1.68 msp95 5.32 ms | 2.55 msp95 5.02 ms | 1.87 msp95 3.29 ms | −27% |
| aggregate | 6.91 msp95 8.11 ms | 11.4 msp95 14.4 ms | 12.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 pushcreates from the benchmark schema: unique ids and emails, a range index onUser.age, a cosine vector index. - Same conditions. Every Bolt contender uses
neo4j-driver6.3.2 with default settings and the explicit databaseneo4j. 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 toDate).
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.
| Scenario | Contender | median | p95 | mean | ops/s | samples |
|---|---|---|---|---|---|---|
| findUnique by id | neo4j-driver | 0.81 ms | 1.26 ms | 0.90 ms ±2.0% | 1,112 | 3338 |
| findUnique by id | Cyphra | 0.86 ms | 1.30 ms | 0.93 ms ±1.4% | 1,072 | 3221 |
| findUnique by id | neogma | 0.57 ms | 1.04 ms | 0.64 ms ±1.4% | 1,557 | 4674 |
| findUnique by id | @neo4j/graphql | 1.35 ms | 2.52 ms | 1.52 ms ±1.7% | 660 | 1981 |
| findUnique by id | @cyphra/graphql | 0.91 ms | 1.34 ms | 0.98 ms ±1.2% | 1,021 | 3064 |
| findUnique by id | Query API (fetch) | 1.99 ms | 3.69 ms | 2.29 ms ±2.3% | 437 | 1313 |
| findUnique by id | Cyphra HTTP | 1.94 ms | 2.80 ms | 2.05 ms ±1.3% | 489 | 1467 |
| findMany, filter + order + limit 50 | neo4j-driver | 4.54 ms | 7.40 ms | 4.96 ms ±2.1% | 202 | 606 |
| findMany, filter + order + limit 50 | Cyphra | 4.91 ms | 7.29 ms | 5.16 ms ±1.7% | 194 | 584 |
| findMany, filter + order + limit 50 | neogma | 3.88 ms | 5.64 ms | 4.07 ms ±1.5% | 246 | 738 |
| findMany, filter + order + limit 50 | @neo4j/graphql | 5.58 ms | 7.89 ms | 5.98 ms ±2.4% | 167 | 503 |
| findMany, filter + order + limit 50 | @cyphra/graphql | 5.47 ms | 7.59 ms | 5.74 ms ±1.5% | 174 | 524 |
| findMany, filter + order + limit 50 | Query API (fetch) | 5.25 ms | 6.70 ms | 5.39 ms ±1.2% | 186 | 558 |
| findMany, filter + order + limit 50 | Cyphra HTTP | 5.42 ms | 7.88 ms | 5.81 ms ±2.0% | 172 | 517 |
| Nested read, 2 levels | neo4j-driver | 2.76 ms | 4.08 ms | 2.96 ms ±1.9% | 337 | 1014 |
| Nested read, 2 levels | Cyphra | 2.77 ms | 4.02 ms | 2.96 ms ±1.8% | 337 | 1014 |
| Nested read, 2 levels | neogma | 3.82 ms | 6.05 ms | 4.24 ms ±3.7% | 236 | 709 |
| Nested read, 2 levels | @neo4j/graphql | 4.30 ms | 6.16 ms | 4.56 ms ±1.8% | 220 | 661 |
| Nested read, 2 levels | @cyphra/graphql | 3.52 ms | 5.57 ms | 3.79 ms ±1.9% | 264 | 794 |
| Nested read, 2 levels | Query API (fetch) | 3.34 ms | 4.52 ms | 3.51 ms ±1.8% | 285 | 856 |
| Nested read, 2 levels | Cyphra HTTP | 4.05 ms | 5.76 ms | 4.35 ms ±2.3% | 230 | 692 |
| create | neo4j-driver | 1.30 ms | 1.95 ms | 1.42 ms ±2.9% | 705 | 2118 |
| create | Cyphra | 1.51 ms | 2.38 ms | 1.62 ms ±1.8% | 618 | 1854 |
| create | neogma | 0.99 ms | 1.58 ms | 1.08 ms ±2.8% | 929 | 2788 |
| create | @neo4j/graphql | 2.31 ms | 3.30 ms | 2.46 ms ±2.1% | 406 | 1219 |
| create | @cyphra/graphql | 1.73 ms | 2.53 ms | 1.82 ms ±4.3% | 549 | 1650 |
| create | Query API (fetch) | 2.48 ms | 3.54 ms | 2.61 ms ±1.5% | 384 | 1152 |
| create | Cyphra HTTP | 2.75 ms | 3.81 ms | 2.87 ms ±1.2% | 348 | 1046 |
| Nested create (user + 5 posts) | neo4j-driver | 1.43 ms | 2.15 ms | 1.56 ms ±2.4% | 642 | 1926 |
| Nested create (user + 5 posts) | Cyphra | 1.59 ms | 2.60 ms | 1.75 ms ±3.3% | 570 | 1712 |
| Nested create (user + 5 posts) | neogma | 1.22 ms | 2.04 ms | 1.41 ms ±4.2% | 710 | 2132 |
| Nested create (user + 5 posts) | @neo4j/graphql | 2.66 ms | 3.68 ms | 2.83 ms ±2.7% | 354 | 1063 |
| Nested create (user + 5 posts) | @cyphra/graphql | 1.97 ms | 3.07 ms | 2.15 ms ±2.1% | 465 | 1397 |
| Nested create (user + 5 posts) | Query API (fetch) | 2.48 ms | 3.72 ms | 2.91 ms ±13.5% | 344 | 1031 |
| Nested create (user + 5 posts) | Cyphra HTTP | 3.02 ms | 4.24 ms | 3.23 ms ±1.5% | 310 | 931 |
| upsert | neo4j-driver | 0.88 ms | 1.26 ms | 0.95 ms ±1.4% | 1,055 | 3167 |
| upsert | Cyphra | 0.96 ms | 1.38 ms | 1.04 ms ±1.6% | 961 | 2886 |
| upsert | Query API (fetch) | 1.73 ms | 4.06 ms | 2.04 ms ±2.3% | 490 | 1472 |
| upsert | Cyphra HTTP | 1.95 ms | 2.89 ms | 2.11 ms ±1.5% | 474 | 1423 |
| update by unique | neo4j-driver | 0.86 ms | 1.20 ms | 0.93 ms ±2.0% | 1,071 | 3214 |
| update by unique | Cyphra | 0.88 ms | 1.34 ms | 0.95 ms ±1.3% | 1,052 | 3159 |
| update by unique | neogma | 0.64 ms | 0.87 ms | 0.68 ms ±1.1% | 1,477 | 4433 |
| update by unique | @neo4j/graphql | 1.53 ms | 2.06 ms | 1.59 ms ±1.0% | 630 | 1892 |
| update by unique | @cyphra/graphql | 1.08 ms | 1.62 ms | 1.15 ms ±1.1% | 866 | 2600 |
| update by unique | Query API (fetch) | 1.62 ms | 2.21 ms | 1.70 ms ±1.0% | 590 | 1771 |
| update by unique | Cyphra HTTP | 1.75 ms | 2.69 ms | 1.93 ms ±2.0% | 518 | 1556 |
| delete with cascade | neo4j-driver | 1.51 ms | 3.31 ms | 1.78 ms ±2.2% | 562 | 1688 |
| delete with cascade | Cyphra | 1.76 ms | 3.64 ms | 2.03 ms ±2.2% | 492 | 1477 |
| delete with cascade | @neo4j/graphql | 1.98 ms | 3.30 ms | 2.18 ms ±1.5% | 459 | 1378 |
| delete with cascade | @cyphra/graphql | 1.54 ms | 3.04 ms | 1.80 ms ±2.3% | 557 | 1673 |
| delete with cascade | Query API (fetch) | 2.54 ms | 5.50 ms | 2.98 ms ±2.6% | 335 | 1007 |
| delete with cascade | Cyphra HTTP | 2.89 ms | 6.32 ms | 3.38 ms ±2.7% | 296 | 891 |
| Relation count | neo4j-driver | 1.68 ms | 5.32 ms | 2.18 ms ±3.2% | 460 | 1382 |
| Relation count | Cyphra | 1.56 ms | 3.25 ms | 1.79 ms ±2.0% | 559 | 1678 |
| Relation count | @neo4j/graphql | 2.55 ms | 5.02 ms | 2.93 ms ±2.1% | 341 | 1024 |
| Relation count | @cyphra/graphql | 1.87 ms | 3.29 ms | 2.09 ms ±1.7% | 478 | 1435 |
| Relation count | Query API (fetch) | 2.25 ms | 7.27 ms | 2.90 ms ±3.3% | 345 | 1039 |
| Relation count | Cyphra HTTP | 2.31 ms | 4.54 ms | 2.67 ms ±2.5% | 375 | 1129 |
| aggregate | neo4j-driver | 6.91 ms | 8.11 ms | 7.11 ms ±1.2% | 141 | 424 |
| aggregate | Cyphra | 6.90 ms | 7.86 ms | 7.18 ms ±1.8% | 139 | 419 |
| aggregate | @neo4j/graphql | 11.4 ms | 14.4 ms | 11.9 ms ±2.0% | 84 | 253 |
| aggregate | @cyphra/graphql | 12.0 ms | 13.6 ms | 12.3 ms ±0.9% | 81 | 246 |
| aggregate | Query API (fetch) | 7.35 ms | 9.20 ms | 7.64 ms ±1.5% | 131 | 394 |
| aggregate | Cyphra HTTP | 7.48 ms | 8.20 ms | 7.61 ms ±0.9% | 131 | 396 |
| groupBy | neo4j-driver | 8.68 ms | 9.78 ms | 8.86 ms ±1.0% | 113 | 341 |
| groupBy | Cyphra | 8.69 ms | 9.27 ms | 8.81 ms ±1.0% | 114 | 342 |
| groupBy | Query API (fetch) | 9.12 ms | 10.3 ms | 9.33 ms ±1.2% | 107 | 323 |
| groupBy | Cyphra HTTP | 9.29 ms | 10.3 ms | 9.44 ms ±0.9% | 106 | 319 |
| 3-hop traversal | neo4j-driver | 4.55 ms | 6.38 ms | 4.79 ms ±1.3% | 209 | 628 |
| 3-hop traversal | Cyphra | 4.83 ms | 6.42 ms | 5.00 ms ±0.9% | 200 | 601 |
| 3-hop traversal | Query API (fetch) | 4.10 ms | 11.8 ms | 5.28 ms ±4.3% | 190 | 571 |
| 3-hop traversal | Cyphra HTTP | 4.58 ms | 11.5 ms | 5.51 ms ±4.0% | 182 | 547 |
| Shortest path | neo4j-driver | 1.11 ms | 1.75 ms | 1.20 ms ±1.4% | 836 | 2510 |
| Shortest path | Cyphra | 1.25 ms | 2.24 ms | 1.36 ms ±1.7% | 733 | 2199 |
| Shortest path | Query API (fetch) | 2.78 ms | 4.61 ms | 3.07 ms ±2.5% | 326 | 979 |
| Shortest path | Cyphra HTTP | 3.19 ms | 5.74 ms | 3.45 ms ±2.3% | 290 | 870 |
| Vector findSimilar (k = 10) | neo4j-driver | 1.53 ms | 3.14 ms | 1.85 ms ±5.0% | 540 | 1621 |
| Vector findSimilar (k = 10) | Cyphra | 1.69 ms | 3.66 ms | 1.95 ms ±2.3% | 512 | 1538 |
| Vector findSimilar (k = 10) | Query API (fetch) | 3.99 ms | 12.8 ms | 5.83 ms ±5.1% | 171 | 515 |
| Vector findSimilar (k = 10) | Cyphra HTTP | 4.79 ms | 18.2 ms | 6.39 ms ±5.4% | 156 | 472 |
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.