Repository navigation
Conversation
…ced its numbers A plain-English competitive writeup vs SQLite, RocksDB, LMDB and FASTER, plus what a single operation costs inside Typhon. Every figure is reproducible from this repository and the run commands are given with each section. The document opens with a disclaimer, and the disclaimer is the point. Comparative benchmarks published without a method are worthless, and ours name real products. So it states plainly that the competitor adapters were written to the best of our knowledge, may be far from optimal, and that where one is naive the number flatters Typhon. It cites the LMDB defect found and fixed before publishing as evidence that this is not boilerplate, and invites PRs against the adapters. Deliberately not published: multipliers in the hundreds or thousands. SQLite and LMDB serialise writers by design, so a four-digit ratio on a mixed workload describes the workload rather than the engine. Those cells give the raw figure plus a footnote explaining the design choice. LmdbConcurrentAdapter is fixed here because it changed the published numbers. It was calling tx.OpenDatabase() per batch - that is mdb_dbi_open, which takes an environment-wide lock - and allocating two byte[8] per operation inside the measured loop. The handle is now opened once and shared; keys and values are stackalloc. The correction costs us: LMDB goes 64.9 -> 70.6 M/s on batched reads (now ahead of Typhon) and 214.7 -> 421.3 on range scans, taking its scan lead from 1.8x to 3.6x. ReadValidationProbe (-- verify) checks every engine's read path against an analytically known checksum before any number is trusted. The concurrent runners accumulate a checksum only to defeat dead-code elimination and never verify it, so an adapter that returned nothing or resolved the wrong row would post a great number unnoticed. All five engines pass. It is also the gate for further adapter tuning. Typhon-side measurement classes, all on one shared fixture so the figures are comparable to each other: - StorageModeProofBenchmarks - the mode x scope matrix behind section 4 - EcsAccessPathBenchmarks - point access vs flat cluster sweep vs cell-scoped sweep vs 3x3 neighbourhood, with a setup-time checksum assert proving all three full-world routes visit the same entities - BulkLoadProfile (--bulk-load) - the four ingest routes against a real on-disk WAL. BDN could not measure this: a fresh engine per sample gave +/-20us error on a 2.3us mean - EcsLifecycleBenchmarks - spawn/destroy/commit, source of the DestroyBatch figure ArchetypeAccessorBenchmark loses the AaBench component and archetype declarations, which move to Ecs/EcsBenchFixtures.cs so the new classes can share them. Same namespace, no consumer changes. Placed in benchmark/ rather than doc/ on purpose: doc/ is the DocFx site published to doc.typhondb.io, and publishing competitive numbers there is a separate decision. benchmark/ is also outside doc-accuracy-review.yml's path filter and has no benchmark.yml trigger, so this adds no CI load. Contains one result we did not expect and publish anyway: BulkLoad is 3.1x faster than a naive loader - the baseline its acceptance criterion used - but 0.73x against a loader that simply batches its commits, because the WAL writer already batches asynchronously and the end-of-session forced checkpoint costs more than the per-row records it skips. Holds at 4M entities. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mo2eUeYS5SW6uta72uTfyx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A plain-English competitive writeup against SQLite, RocksDB, LMDB and FASTER, plus what a single operation costs inside Typhon. Every figure is reproducible from this repository, and the run commands sit next to each section.
13 files, +2 071 / −118. Everything here either is the document or produced a number in it. No engine code is touched.
Why the disclaimer is at the top
Comparative benchmarks published without a method are worthless, and ours name real products. So the document states plainly that the competitor adapters were written to the best of our knowledge, may be far from optimal, and that where one is naive the number flatters Typhon — a defect in our measurement, not a property of that engine. It invites PRs against the adapters.
That is not boilerplate, and the PR proves it.
The LMDB adapter is fixed here, because it changed the published numbers
Reviewing before publishing, the adapter was found calling
tx.OpenDatabase()on every batch — that ismdb_dbi_open, which takes an environment-wide lock and is documented as a startup-time call — and allocating twobyte[8]per operation inside the measured loop. The handle is now opened once and shared across workers; keys and values arestackalloc.The correction costs us:
Remaining known headroom is documented in the adapter rather than hidden: LMDB read transactions could be pooled with
Reset()/Renew(). Not applied.Extreme ratios deliberately not published
SQLite and LMDB both serialise writers by design. On a mixed workload a four-digit multiplier describes the workload, not the engine. Those cells give the raw figure plus a footnote explaining the design choice, and state that read-mostly or single-writer workloads are unaffected.
Also dropped: a "time to commit a transaction" row whose RocksDB/LMDB figures came from the fsync-inclusive path while everything else is no-fsync. Mixing durability tiers in one table is the error this exercise exists to remove.
Read paths are checksum-verified before any number is trusted
ReadValidationProbe(-- verify) checks every engine's read path against an analytically known checksum. The concurrent runners accumulate a checksum only to defeat dead-code elimination and never verify it — so an adapter that returned nothing, read a stale snapshot, or resolved the wrong row would post a great number and nothing would notice. All five engines pass. It is also the gate for future adapter tuning: a faster adapter that stops returning correct rows now fails loudly.EcsAccessPathBenchmarksapplies the same discipline internally — a setup-time assert proves all three full-world routes visit the same entities, otherwise the ratios between them mean nothing.Typhon-side measurement classes
All on one shared fixture, so the figures are comparable to each other:
StorageModeProofBenchmarks— the mode × scope matrix behind §4EcsAccessPathBenchmarks— point access vs flat cluster sweep vs cell-scoped sweep vs 3×3 neighbourhoodBulkLoadProfile(--bulk-load) — the four ingest routes against a real on-disk WAL. BDN could not measure this: a fresh engine per sample gave ±20 µs error on a 2.3 µs meanEcsLifecycleBenchmarks— spawn/destroy/commitArchetypeAccessorBenchmarkloses theAaBench*component and archetype declarations, which move toEcs/EcsBenchFixtures.csso the new classes can share them. Same namespace, no consumer changes. This is the only deletion in the PR and it is a hard compile dependency.One result we did not expect, published anyway
BulkLoadis 3.1× faster than a naive loader — the baseline its acceptance criterion used — but 0.73× against a loader that simply batches its commits. The WAL writer already batches asynchronously, so a per-row record costs a memory copy rather than a disk write, and the end-of-session forced checkpoint costs more than the records it skips. Holds at 4 M entities.Worth a follow-up on its own:
BulkLoadSessioncarries a manifest pair, an exclusive engine gate, a recovery path and a documented page-leak-on-abort limitation, and currently buys nothing overcommit every 8192.Placement
benchmark/, notdoc/.doc/is the DocFx site published to doc.typhondb.io, and publishing competitive numbers there is a separate decision.benchmark/is also outsidedoc-accuracy-review.yml's path filter and has nobenchmark.ymltrigger, so this adds no CI load.Verification
Built from the committed state alone in a throwaway worktree —
Typhon.Benchmark,Typhon.CompetitiveBenchmarkand the full solution all build with zero errors.Measured 2026-07-29 on a 7950X (16 threads, one CCD), Windows 11, .NET 10, engine revision
81e2a46.🤖 Generated with Claude Code
https://claude.ai/code/session_01Mo2eUeYS5SW6uta72uTfyx