Repository navigation
perf: performance envelope at 100K–10M facts (#394) - #533
Merged
Merged
Conversation
examples/perf_envelope.rs builds and caches fixtures of N facts (six attributes per entity, a ref tree, two valid-time windows, a hot entity with 1,000 versions) and reports open and checkpoint times, RSS, and p50/p99 latency for twelve query shapes. The build, the storage measurements and each shape run in their own child process, so each peak RSS is that step's alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
The harness now runs each query shape in its own process (open costs ~0.1 ms) so each peak RSS is that shape's alone, abandons a shape after --cap-secs, and reports a query error such as INT-020 as the shape's result. It builds with a new envelope profile: release is opt-level z for the REPL binary's size and runs these queries ~1.5x slower than an application's opt-level 3 build. docs/BENCHMARKS.md and the README publish the envelope: point lookups and single-entity time travel stay at 12-14 us up to 10M facts; scans, aggregations and joins grow with the attributes they touch; rule queries are supported to 100K facts. A Python FFI round trip adds ~70 us per query. Profiling at 1M facts filed #528-#532. envelope.yml runs 100K and 1M on demand and a 10K smoke pass on PRs that change the harness. The nightly query/* Criterion groups gain 100k and 1m scales. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Closes #394 (closing keywords don't fire on
v3; close it by hand after merge).What
examples/perf_envelope.rsbuilds and caches fixtures of 100K, 1M and 10M facts: six attributes per entity, a:managerref tree, two valid-time windows, and an entity with 1,000 versions. It measures open and checkpoint time, RSS, and p50/p99 for twelve query shapes. The build, the storage measurements and each shape run in their own process, so each peak RSS is that step's alone. A shape is abandoned after--cap-secs, and a query error (such asINT-020) is recorded as the shape's result.[profile.envelope]:releaseat opt-level 3, which is how an application's release build compiles the library.releaseandbench(which inherits it) are opt-level "z" and run these queries about 1.5× slower. That also applies to the existing Criterion numbers; this PR leaves them unchanged.docs/BENCHMARKS.mdgets a performance envelope section: what is supported, what is not, the full tables, the fixture, the profile breakdown and the Python FFI round trip. The README's stale v5-era performance table is replaced with a summary..github/workflows/envelope.ymlruns 100K and 1M onworkflow_dispatch, and a 10K smoke pass on PRs that change the harness.query/*groups gain 100k and 1m scales.docs/superpowers/specs/2026-10-11-perf-envelope-design.md.Headline results (opt-level 3, i7-1065G7, SSD)
INT-020Follow-ups filed from profiling at 1M facts
INT-020on any database with ≥1M live facts, because the evaluator counts base facts againstmax_results. Affects v0.18.0–v2.0.4. The workaround (:max-resultsraised) was checked on the 1M fixture.net_asserted_factsre-runs over committed facts thatlive_factsalready resolved.The Python side is a separate PR to minigraf-python
v3(bench/envelope.py).Testing
cargo fmt --check,cargo clippy -- -D warnings,cargo bench --no-runandcargo build --examplesare clean. The pre-push hook ran the test suite.🤖 Generated with Claude Code
https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h