compare-run.sh answers "how do we compare to MongoDB"; it says nothing
about whether a change made things better or worse than last week. Add a
harness that records each run and diffs it against the previous one.
bench-run.sh wraps compare-run.sh, adds a concurrent durable-write
comparison (concurrent.js: N clients each doing sequential insertOne with
{w:1, j:true}, exercising the group-commit path under real contention),
writes a versioned name<TAB>value report to results/bench-<timestamp>.txt,
and prints a diff of our numbers against results/bench-latest.txt.
Also:
- compare-run.sh polled with fixed sleeps, which are flaky once earlier
benchmark phases have warmed the machine; both servers now wait on a
real driver connection instead.
- a dispatch error only reached the client as a generic InternalError,
with nothing on the server side naming the failing command; log the
connection, command and error name before replacing the reply.
37 lines
1.0 KiB
Plaintext
37 lines
1.0 KiB
Plaintext
# mongo-lite vs MongoDB benchmark
|
||
# date: 2026-08-03T08:36:09Z git: c8d547f+dirty
|
||
# args: size=1g doc-size=16k wc=j clients=1 4 8 16 32 per-client=2000
|
||
# reproduce: bash tests/e2e/bench-run.sh 1g 16k "1 4 8 16 32"
|
||
|
||
[main]
|
||
insertOne (sequential) ×200 0.20 ms 4.9 ms
|
||
bulk insert throughput 748.8 MB/s 685.2 MB/s
|
||
docs loaded 65,536 65,536
|
||
createIndex({k: 1}) 79.8 ms 86.6 ms
|
||
countDocuments({}) 3.4 ms 13.6 ms
|
||
findOne({_id: <ObjectId>}) 0.71 ms 0.61 ms
|
||
findOne({k: 500}) (indexed) 0.66 ms 2.0 ms
|
||
find({p: {$gte,$lt}}).count() (scan) 13.5 ms 12.4 ms
|
||
find({}).sort({_id:-1}).limit(20) 2.3 ms 2.6 ms
|
||
find({}, {proj}).limit(1000) 3.6 ms 4.4 ms
|
||
aggregate $group by k 9.5 ms 13.7 ms
|
||
updateOne({_id}) ×50 0.14 ms 0.18 ms
|
||
updateMany({k: 7}, {$inc}) 2.1 ms 6.1 ms
|
||
deleteOne({_id}) + insertOne 0.73 ms 5.0 ms
|
||
node client RSS 160 MB 153 MB
|
||
|
||
[concurrency]
|
||
clients 1 8816 203 43.4x
|
||
clients 4 22142 472 46.9x
|
||
clients 8 27716 967 28.7x
|
||
clients 16 32031 1858 17.2x
|
||
clients 32 3759 0.0x
|
||
|
||
[meta]
|
||
ml_rss_mb 547
|
||
md_rss_mb 1317
|
||
ml_reopen 0.8s
|
||
md_reopen 1.3s
|
||
ml_disk_mb 97MB
|
||
md_disk_mb 89MB
|