Repository navigation
Description
Context
Follow-up bench(es) from PR #1228 review (coverage gaps #2 and #4). Two scan-time fast-paths whose decision boundaries we'd like locked into perf gates:
- Batched object-join in
NestedLoopJoinOperator(memory:mem:fact-01kkrmk7w3gpen60ayv8x2yzqk). BSBM Q5's batched path optimization gave a ~27% local win. Today the regression vector is "we still get the right answer; the join just stops batching and falls back to per-row probes." A targeted bench aroundcolumn_loader.rs::ColumnSet::COREselection and the binary-search-on-runs path would catch a regression thatquery_hot_bsbm/q5would only see as a small percentage. fast_group_count_firsts+COUNT(DISTINCT)shapes (memory:mem:fact-01kpepmqtapmksm216fde5jv75). The fast-path detection bug noted in that memory ID is precisely the kind of perf regression a targeted bench would catch — first-triple detection vs. order-insensitive detection.query_hot_bsbm/q9exercises group-by + count + having on a different shape; the same-subject existence-only join shape is uncovered.
Bundling these in one issue (and one PR) because both are scan-time fast-path micro-benches under fluree-db-query and could share a setup module.
Scope
Add two scenarios under fluree-db-query/benches/ (or fluree-db-api/benches/ if the bench needs the full Fluree stack — pick whichever lets the bench run in single-digit seconds at tiny):
query_join_batched.rs— exercisesNestedLoopJoinOperator's batched path. Two scenarios: "batched-eligible shape" (current fast path) vs. "batched-ineligible shape" (forces per-row probes). Both should be locked into the budget so a regression that flips the gate is loud.query_group_count_firsts.rs— exercises thefast_group_count_firstsdetection path. Two scenarios: "first-triple shape" (current fast path) vs. "order-insensitive same-subject shape" (the uncovered regression vector).
Each:
- Use the chassis pattern.
bench_runtime(),current_profile(),current_scale(),next_ledger_alias(). - Deterministic data via
gen::peopleorgen::bsbm(or a new generator if the data shape required by the fast path doesn't fit either; lift it intogen::if reusable). - Register budgets in
regression-budget.jsonfor both crate/bench pairs.
Acceptance
- Both benches compile and run
--testgreen attiny. -
regression-budget.jsonhas entries for both. -
BENCHMARKING.md's table grows two rows. - Bench-gate CI job picks them up.
- Documented in the relevant memory entries (memory IDs above) so a future regression hunt finds them.
References
- PR Workspace-Wide Benchmarking Foundation #1228 review: coverage gaps Link to CLA and document min version of tools-deps #2 + FC-878 No promise API for history-query #4.
- Memory:
mem:fact-01kkrmk7w3gpen60ayv8x2yzqk(BSBM Q5 batched-path win),mem:fact-01kpepmqtapmksm216fde5jv75(fast-path detection bug).
Implementation notes
If the two benches end up sharing nontrivial setup or data shapes, consider lifting the shared module to gen:: rather than duplicating across files. If they don't share much, leave them as siblings.
Out of scope
The fast-path implementations themselves are owned by fluree-db-query. This issue is bench coverage only.
Activity
address PR review feedback (1228): fix vector_math determinism, retro…
aaj3f commentedon Aug 25, 2026
Sweep re-verification at
47e96b7b6: neither of the two requested benches exists yet. The post-filing benches (query_overlay_matrixgroupby,query_hot_whole_graph_agg) narrow the macro gap but cover different shapes than the two decision boundaries this issue targets.Worth noting for whoever picks this up: the group-count fast path is now at
group_count_v6— six rewrites since the family was introduced, still with no boundary bench — and the batched object-join boundary injoin.rshas absorbed 33 commits of churn with zero bench coverage of any kind. That churn-without-coverage is exactly the case for these two.Updating the body's implementation pointer to
fluree-db-binary-index/src/read/column_loader.rsand dropping the stalemem:fact-*references.