MongoDB
Benchmarks
How ARX compares with other ways of doing the same work on MongoDB, measured with BenchmarkDotNet.
ARX.SDK's MongoDB provider against the hand-written driver code a developer would write (BsonDocument, the baseline)
and the driver's typed API (POCO classes). BenchmarkDotNet job Standard (3 warm-ups, 8 iterations), Release, on the
arx-mongo container (MongoDB 7.0, a single-node replica set, Docker Desktop on Windows), database arx_bench.
Reports in results/. Ratios are against the raw driver; numbers from one machine, so read the ratios, not the times.
| Operation | ARX against the raw driver | Against the typed driver |
|---|---|---|
| Create, one document | 0.92ร (level) | level |
| CreateMultiple, 100 to 10,000 documents, all in one transaction | 0.90โ0.97ร (level) | level to 1.3ร |
| UpdateMultiple by id, 100 and 1,000 documents, in a transaction, each checked found | 1.16ร, 1.07ร | โ |
| Update one document | 0.64ร (ARX skips the transaction for one document) | โ |
| DeleteMultiple by id, 100 to 10,000 | 0.93โ1.24ร (inside the spread: the single-operation runs vary ยฑ40%) | โ |
| Retrieve by id | 1.16ร (0.17 ms) | 1.06ร |
| RetrieveMultiple, 100 / 1,000 / 10,000 documents | 0.98ร / 1.17ร / 1.35ร | the typed driver is 0.61ร the raw one at 10,000 |
What the numbers say: writes are level with the driver; reads cost the dictionary entity (2.2ร the raw driver's allocations), as on PostgreSQL, SQL Server and MySQL.
The reports
BenchmarkDotNet's own output for the runs the summary cites, as committed: every number above comes from one of these.
CreateBenchmarks
BenchmarkDotNet v0.15.8, Windows 11 (10.0.26200.9711/25H2/2025Update/HudsonValley2)
Intel Core i7-8750H CPU 2.20GHz (Max: 2.21GHz) (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
.NET SDK 10.0.403
[Host] : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v3
Standard : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v3
Job=Standard IterationCount=8 LaunchCount=1
WarmupCount=3
| Method | Mean | Error | StdDev | Ratio | RatioSD | Gen0 | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|
| 'Raw driver: BsonDocument InsertOne' | 3.016 ms | 0.7792 ms | 0.3460 ms | 1.01 | 0.15 | 3.9063 | 24.39 KB | 1.00 |
| 'Typed driver: POCO InsertOne' | 2.996 ms | 0.8458 ms | 0.4424 ms | 1.00 | 0.18 | 3.9063 | 23.51 KB | 0.96 |
| 'ARX CreateAsync' | 2.733 ms | 0.1907 ms | 0.0998 ms | 0.92 | 0.10 | 3.9063 | 30.5 KB | 1.25 |
CreateMultipleBenchmarks
BenchmarkDotNet v0.15.8, Windows 11 (10.0.26200.9711/25H2/2025Update/HudsonValley2)
Intel Core i7-8750H CPU 2.20GHz (Max: 2.21GHz) (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
.NET SDK 10.0.403
[Host] : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v3
Standard : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v3
Job=Standard IterationCount=8 LaunchCount=1
WarmupCount=3
| Method | Rows | Mean | Error | StdDev | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 'Raw driver: insertMany in a transaction' | 100 | 8.137 ms | 1.2615 ms | 0.5601 ms | 1.00 | 0.09 | 39.0625 | 7.8125 | - | 194.43 KB | 1.00 |
| 'Raw driver: insertMany, no transaction' | 100 | 5.858 ms | 0.7550 ms | 0.3949 ms | 0.72 | 0.06 | 31.2500 | - | - | 175.72 KB | 0.90 |
| 'Typed driver: POCO insertMany in a transaction' | 100 | 9.189 ms | 2.3754 ms | 1.2424 ms | 1.13 | 0.16 | 15.6250 | - | - | 105.58 KB | 0.54 |
| 'ARX CreateMultipleAsync' | 100 | 7.296 ms | 1.4536 ms | 0.6454 ms | 0.90 | 0.09 | 78.1250 | 15.6250 | - | 382.69 KB | 1.97 |
| 'Raw driver: insertMany in a transaction' | 1000 | 25.007 ms | 11.0465 ms | 4.9047 ms | 1.03 | 0.25 | 285.7143 | - | - | 1595.13 KB | 1.00 |
| 'Raw driver: insertMany, no transaction' | 1000 | 25.456 ms | 8.5068 ms | 4.4492 ms | 1.05 | 0.24 | 250.0000 | 156.2500 | - | 1574.51 KB | 0.99 |
| 'Typed driver: POCO insertMany in a transaction' | 1000 | 17.774 ms | 1.8497 ms | 0.8213 ms | 0.73 | 0.12 | 133.3333 | - | - | 676.5 KB | 0.42 |
| 'ARX CreateMultipleAsync' | 1000 | 23.501 ms | 3.2235 ms | 1.6859 ms | 0.97 | 0.17 | 531.2500 | 500.0000 | - | 3394.15 KB | 2.13 |
| 'Raw driver: insertMany in a transaction' | 10000 | 228.185 ms | 57.7942 ms | 20.6100 ms | 1.01 | 0.12 | 4000.0000 | 2000.0000 | 1000.0000 | 16047.28 KB | 1.00 |
| 'Raw driver: insertMany, no transaction' | 10000 | 209.726 ms | 84.0379 ms | 43.9535 ms | 0.93 | 0.20 | 3500.0000 | 2000.0000 | 1000.0000 | 15948.18 KB | 0.99 |
| 'Typed driver: POCO insertMany in a transaction' | 10000 | 219.670 ms | 140.5850 ms | 73.5287 ms | 0.97 | 0.32 | 1500.0000 | 1000.0000 | 500.0000 | 6703.72 KB | 0.42 |
| 'ARX CreateMultipleAsync' | 10000 | 204.962 ms | 29.5615 ms | 15.4612 ms | 0.90 | 0.10 | 6000.0000 | 2000.0000 | 1000.0000 | 34002.55 KB | 2.12 |
DeleteMultipleBenchmarks
BenchmarkDotNet v0.15.8, Windows 11 (10.0.26200.9711/25H2/2025Update/HudsonValley2)
Intel Core i7-8750H CPU 2.20GHz (Max: 2.21GHz) (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
.NET SDK 10.0.403
[Host] : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v3
SingleOperation : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v3
Job=SingleOperation InvocationCount=1 IterationCount=12
LaunchCount=1 RunStrategy=Monitoring UnrollFactor=1
WarmupCount=1
| Method | Rows | Mean | Error | StdDev | Median | Ratio | RatioSD | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|---|
| 'Raw driver: deleteMany with $in' | 100 | 8.017 ms | 6.1821 ms | 4.8266 ms | 6.265 ms | 1.17 | 0.76 | 30.32 KB | 1.00 |
| 'ARX DeleteMultipleAsync' | 100 | 6.396 ms | 0.9137 ms | 0.7134 ms | 6.486 ms | 0.93 | 0.27 | 45.81 KB | 1.51 |
| 'Raw driver: deleteMany with $in' | 1000 | 19.531 ms | 6.2532 ms | 4.8821 ms | 18.683 ms | 1.04 | 0.30 | 72.54 KB | 1.00 |
| 'ARX DeleteMultipleAsync' | 1000 | 21.908 ms | 7.3367 ms | 5.7280 ms | 19.523 ms | 1.16 | 0.35 | 193.49 KB | 2.67 |
| 'Raw driver: deleteMany with $in' | 10000 | 127.628 ms | 19.0218 ms | 14.8510 ms | 124.243 ms | 1.01 | 0.16 | 874.71 KB | 1.00 |
| 'ARX DeleteMultipleAsync' | 10000 | 156.551 ms | 72.9056 ms | 56.9199 ms | 141.217 ms | 1.24 | 0.46 | 1950.85 KB | 2.23 |
RetrieveBenchmarks
BenchmarkDotNet v0.15.8, Windows 11 (10.0.26200.9711/25H2/2025Update/HudsonValley2)
Intel Core i7-8750H CPU 2.20GHz (Max: 2.21GHz) (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
.NET SDK 10.0.403
[Host] : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v3
Standard : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v3
Job=Standard IterationCount=8 LaunchCount=1
WarmupCount=3
| Method | Rows | Mean | Error | StdDev | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 'Raw driver: Find to a BsonDocument list' | 1 | 1.008 ms | 0.0751 ms | 0.0333 ms | 1.00 | 0.04 | 3.9063 | - | - | 23.32 KB | 1.00 |
| 'Typed driver: Find to a POCO list' | 1 | 1.104 ms | 0.1028 ms | 0.0538 ms | 1.10 | 0.06 | 3.9063 | - | - | 26.71 KB | 1.15 |
| 'ARX RetrieveAsync / RetrieveMultipleAsync' | 1 | 1.173 ms | 0.1970 ms | 0.1030 ms | 1.16 | 0.10 | 5.8594 | - | - | 30.27 KB | 1.30 |
| 'Raw driver: Find to a BsonDocument list' | 100 | 2.149 ms | 0.8381 ms | 0.4383 ms | 1.03 | 0.26 | 39.0625 | 7.8125 | - | 201.42 KB | 1.00 |
| 'Typed driver: Find to a POCO list' | 100 | 1.782 ms | 0.0804 ms | 0.0287 ms | 0.86 | 0.14 | 15.6250 | - | - | 88.26 KB | 0.44 |
| 'ARX RetrieveAsync / RetrieveMultipleAsync' | 100 | 2.051 ms | 0.2208 ms | 0.0980 ms | 0.98 | 0.17 | 70.3125 | 23.4375 | - | 331.6 KB | 1.65 |
| 'Raw driver: Find to a BsonDocument list' | 1000 | 8.528 ms | 0.7515 ms | 0.3337 ms | 1.00 | 0.05 | 328.1250 | 218.7500 | - | 1898.9 KB | 1.00 |
| 'Typed driver: Find to a POCO list' | 1000 | 8.415 ms | 0.9108 ms | 0.4764 ms | 0.99 | 0.06 | 140.6250 | 31.2500 | - | 673.23 KB | 0.35 |
| 'ARX RetrieveAsync / RetrieveMultipleAsync' | 1000 | 9.924 ms | 0.2437 ms | 0.1082 ms | 1.17 | 0.04 | 515.6250 | 453.1250 | - | 3139.47 KB | 1.65 |
| 'Raw driver: Find to a BsonDocument list' | 10000 | 101.618 ms | 22.8524 ms | 11.9522 ms | 1.01 | 0.15 | 3666.6667 | 2166.6667 | 666.6667 | 18747.98 KB | 1.00 |
| 'Typed driver: Find to a POCO list' | 10000 | 60.805 ms | 2.6734 ms | 1.1870 ms | 0.61 | 0.06 | 1125.0000 | 375.0000 | 125.0000 | 6411.51 KB | 0.34 |
| 'ARX RetrieveAsync / RetrieveMultipleAsync' | 10000 | 135.914 ms | 18.6464 ms | 9.7524 ms | 1.35 | 0.17 | 6000.0000 | 3333.3333 | 1000.0000 | 31099.01 KB | 1.66 |
UpdateMultipleBenchmarks
BenchmarkDotNet v0.15.8, Windows 11 (10.0.26200.9711/25H2/2025Update/HudsonValley2)
Intel Core i7-8750H CPU 2.20GHz (Max: 2.21GHz) (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
.NET SDK 10.0.403
[Host] : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v3
Standard : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v3
Job=Standard IterationCount=8 LaunchCount=1
WarmupCount=3
| Method | Rows | Mean | Error | StdDev | Ratio | RatioSD | Gen0 | Gen1 | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|---|---|
| 'Raw driver: bulkWrite of updateOne in a transaction, matched count checked' | 1 | 4.014 ms | 0.6295 ms | 0.3292 ms | 1.01 | 0.11 | 7.8125 | - | 42.75 KB | 1.00 |
| 'ARX UpdateMultipleAsync' | 1 | 2.562 ms | 0.1282 ms | 0.0569 ms | 0.64 | 0.05 | 3.9063 | - | 30.35 KB | 0.71 |
| 'Raw driver: bulkWrite of updateOne in a transaction, matched count checked' | 100 | 8.792 ms | 0.9294 ms | 0.4861 ms | 1.00 | 0.07 | 15.6250 | - | 125.55 KB | 1.00 |
| 'ARX UpdateMultipleAsync' | 100 | 10.159 ms | 1.5629 ms | 0.8174 ms | 1.16 | 0.11 | 46.8750 | - | 246.68 KB | 1.96 |
| 'Raw driver: bulkWrite of updateOne in a transaction, matched count checked' | 1000 | 45.861 ms | 2.3711 ms | 0.8456 ms | 1.00 | 0.02 | 100.0000 | - | 872.57 KB | 1.00 |
| 'ARX UpdateMultipleAsync' | 1000 | 48.921 ms | 5.1939 ms | 2.7165 ms | 1.07 | 0.06 | 272.7273 | 181.8182 | 2033.12 KB | 2.33 |
Run them yourself
The benchmark code is published, so you can check these numbers on your own machine and database: arx-benchmark-mongodb.zip. It builds against the ARX packages on nuget.org; HOW-TO-RUN.md inside says how to point it at a database and run it. Compare the ratios, not the absolute times.