This document defines the current benchmark harness for Janus backend work.
The benchmark suite is split by engine path so regressions are easier to localize:
storage_write: ingest-only storage throughputhistorical_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_e2eTo 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 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/.