This document defines the current benchmark harness for Janus backend work.
Status: verified against the benchmark targets present in this checkout. It defines how to produce new evidence; it does not endorse older result snapshots as current performance guarantees.
The benchmark suite is split by engine path so regressions are easier to localize:
storage_write: ingest-only storage throughputstorage_footprint_benchmark: persistent on-disk storage footprint after ingestion for Janus versus Oxigraphhistorical_fixed: fixed historical window executionhistorical_sliding: sliding historical window executionlive_injection: live event ingestion to first emitted resulthybrid_baseline: Hybrid Coordination Benchmark, live window plus static baseline joinjanusql_e2e: HTTP/WebSocket Janus-QL first-result latency for historical queriesjanusql_live_mqtt_e2e: HTTP/WebSocket Janus-QL first-result latency for broker-backed live and hybrid queries
These benchmarks are intended for backend performance work on the current repository state. They are not a substitute for a public performance report.
cargo bench already uses Cargo's optimized bench profile, so there is no extra --release
flag to pass here:
cargo bench --bench storage_write
cargo bench --bench historical_fixed
cargo bench --bench historical_sliding
cargo bench --bench live_injection
cargo bench --bench hybrid_baseline
cargo bench --bench janusql_e2e
cargo bench --bench janusql_live_mqtt_e2e
cargo run --release --bin storage_footprint_benchmark -- \
--event-counts 10000,50000 \
--iterations 1 \
--cleanup-runs-after-measurement \
--output-dir results/storage_footprint_localTo verify that all benchmark targets compile without running them:
cargo bench --no-runMeasures StreamingSegmentedStorage::write_rdf_event throughput on fresh storage with large flush
thresholds so the benchmark isolates write-path cost rather than background flush cost.
Measures persistent storage footprint, not RSS memory. The benchmark writes the same deterministic CityBench-style RDF events to:
- Janus's real segmented RDF event-log storage path
- Oxigraph's persistent on-disk store
It then flushes and closes the store, measures the full recursive directory size in bytes, and
records ingest time, events per second, and bytes per event. --include-10m is required before
running the 10,000,000-event case. If --cleanup-runs-after-measurement is enabled, each
per-run store directory is deleted only after its raw CSV row has been written and flushed.
Measures a single fixed historical window query over deterministic stored events in ex:graph1.
Measures a sliding historical window scan over deterministic stored events placed in a recent time range so the windows stay valid relative to the executor's wall-clock based offset logic.
Measures the live path from event injection into LiveStreamProcessing to the first emitted
result. The harness injects a sentinel event at the end to close remaining windows deterministically.
Measures the Hybrid Coordination Benchmark: live window bindings join against static baseline data already materialized into the live engine. This isolates hybrid join cost without requiring an MQTT broker or the HTTP server.
Measures end-to-end Janus-QL latency through the HTTP API:
historical_preloaded: register query, start query, subscribe over WebSocket, wait for first resulthistorical_via_replay: start replay, register query, start query, subscribe over WebSocket, wait for first result
This target currently covers historical Janus-QL end-to-end flows. Full live or hybrid HTTP e2e
benchmarks are covered separately in janusql_live_mqtt_e2e, because Janus live execution is
broker-driven at the API layer.
Measures broker-backed Janus-QL latency through the HTTP API and WebSocket result stream:
mqtt_live_first_result: register a live query, start it, subscribe over WebSocket, publish MQTT events, wait for the first live resultmqtt_hybrid_first_result: register a hybrid query with historical baseline bootstrap, start it, wait for baseline warm-up, subscribe over WebSocket, publish MQTT events, wait for the first live result
This target requires an MQTT broker reachable from the benchmark process. By default it uses
127.0.0.1:1883 and topic sensors, and it can be overridden with:
JANUS_BENCH_MQTT_HOSTJANUS_BENCH_MQTT_PORTJANUS_BENCH_MQTT_TOPICJANUS_BENCH_MQTT_STREAM_URI
When comparing numbers across commits:
- Run on a quiet machine.
- Use the same hardware, Rust toolchain, and bench profile.
- Avoid running multiple benchmark targets in parallel.
- Capture the exact command, branch, and commit SHA with the results.
- Record CPU model, RAM, OS version, and whether the system was thermally constrained.
For routine optimization work:
cargo bench --no-run
cargo bench --bench storage_write
cargo bench --bench historical_fixed
cargo bench --bench historical_sliding
cargo bench --bench live_injection
cargo bench --bench hybrid_baseline
cargo bench --bench janusql_e2e
cargo bench --bench janusql_live_mqtt_e2eFor benchmark result reviews, attach the Criterion output directory from target/criterion/.