bench: expose #1242 update batch-shape measurements - #1384
Conversation
# Conflicts: # TreeDB/collections/api.go
…ce-pr3b' into tmp-pr1340-merge # Conflicts: # TreeDB/collections/api.go # TreeDB/collections/pr3b_semantic_indexed_test.go
|
Drill-down update on explicit I added measurement-only counters for public/scaffolding and flush-preparation buckets, then reran the direct engine benchmark: MONGO_GATEWAY_PROFILE_BENCH_UPDATE_DOCUMENTS=5000 \
MONGO_GATEWAY_PROFILE_BENCH_BATCH_SIZE=5000 \
MONGO_GATEWAY_PROFILE_BENCH_WRITERS=8 \
MONGO_GATEWAY_PROFILE_BENCH_BUFFERED_INDEXED_WRITE_MAX_DOCUMENTS=100000 \
go test ./cmd/mongo_gateway_bench \
-run '^$' \
-bench '^BenchmarkDirectCollectionUpdateBatchBSONIndexes2CityUpdate/batch_(64|512|5000)$' \
-benchtime=50000x -benchmem -count=3 -p=1Key means from this run:
The important finding: the final drain gap is now accounted for.
Per-update dominant named costs at batch 5000: This makes the next optimization discussion more concrete: for this explicit |
#1242 benchmark acceptance summaryRaw artifacts: Comparison setup: stack branch has full #1242 measurement counters; main uses a compatible temporary benchmark scaffold. Main Collection flush-after-staging, docs_5000
DB ordered-root delta-shape, docs_5000
Decision read
|
#1242 benchmark acceptance summaryRaw artifacts: Comparison setup: stack branch has full #1242 measurement counters; main uses a compatible temporary benchmark scaffold. Main Collection flush-after-staging, docs_5000
DB ordered-root delta-shape, docs_5000
Decision read
|
#1242 benchmark acceptance summaryRaw artifacts: Comparison setup: stack branch has the #1242 measurement counters and semantic publish gating. Main uses a compatible temporary benchmark scaffold. Main Values below are medians of the saved Collection flush-after-staging, docs_5000
DB ordered-root delta-shape, docs_5000
Decision read
Current decision: the benchmark suite now demonstrates the intended root-delta/root-apply collapse and a measurable collection flush-after-staging win for the target repeated-ID indexed workload. The stack also no longer shows the earlier many-ID indexed slowdown. Remaining follow-up is to keep reducing allocation cost in the repeated same-ID indexed path, but the acceptance evidence is now strong enough to treat the stack as a real, attributable inner-engine win rather than only an e2e/noise story. |
|
Update pushed: Local validation: Benchmark comparison against the pre-patch branch head Key allocation results:
Timing is still noisy, but the direction is favorable in the large-batch canary: branch-head Changes made:
CI is running on the pushed commit now. |
Summary
Draft measurement PR for #1242. This gives the batch-shape and phase timing work a stable home while the preceding optimization stack continues to settle. The diff points at
mainintentionally; it is expected to shrink as the PR3b/benchmark stack merges.This PR adds:
Updatecombiner behavior against explicitUpdateBatchsizes of 1, 8, 64, 512, and 5000Current Finding
The default concurrent
Updatepath is not reliably producing large batches in the 5k docs / 50k indexed repeated-ID canary.With 8 writers:
UpdateUpdateBatch, batch 64UpdateBatch, batch 512UpdateBatch, batch 5000With 64 writers, the combiner reaches roughly 37-39 items/batch and throughput improves, but it still does not approach the 512+ item regime that best exercises the #1242 memtable/B-tree batching model.
The aggregate branch does reduce root work as expected:
But current default batching is too small to fully amortize the semantic/materialization overhead.
Validation
Benchmark artifacts from local runs:
/tmp/gomap_batch_shape_aggregate_1778010321/tmp/gomap_batch_shape_main_1778010457/tmp/gomap_batch_shape_aggregate_default_w64_1778010572/tmp/gomap_batch_shape_main_default_w64_1778010590Notes
This is measurement-first. It should not change collection semantics. The intended follow-up decision is whether #1242 needs a stronger default batching contract above the current opportunistic synchronous update combiner.