Skip to content

BE-428: HashQL: Simplify traversal tracking to path recording#8498

Open
indietyp wants to merge 28 commits intomainfrom
bm/be-428-hashql-simplify-traversal-tracking-to-path-recording
Open

BE-428: HashQL: Simplify traversal tracking to path recording#8498
indietyp wants to merge 28 commits intomainfrom
bm/be-428-hashql-simplify-traversal-tracking-to-path-recording

Conversation

@indietyp
Copy link
Member

@indietyp indietyp commented Mar 2, 2026

🌟 What is the purpose of this PR?

Replaces the traversal extraction transform pass (which rewrote MIR bodies by splicing load statements and creating new locals) with a pure analysis pass that records which entity paths each block accesses as bitsets. Introduces per-block path transfer cost charging so the placement solver can account for data locality when assigning blocks to backends.

🔍 What does this change?

  • Traversal analysis (traversal/analysis/): walks the body, resolves vertex projections via EntityPath::resolve(), records accessed paths as TraversalPathBitSet. No MIR mutation.
  • Per-block cost analysis (cost/analysis.rs): new BasicBlockCostAnalysis combines per-statement costs with a path transfer premium. For each block, charges a transfer premium on targets that are not the natural origin for the accessed paths (e.g., Interpreter pays a premium for Vectors because Embedding is the origin). Premiums are charged once per block, not per statement.
  • BasicBlockCostVec: the placement solver now operates on precomputed per-block costs. PlacementSolverContext takes blocks: &BasicBlockCostVec instead of separate statement costs and assignment arrays.
  • BlockPartitionedVec<T>: generic offset-table-backed per-block storage, extracted from StatementCostVec internals.
  • TraversalLattice: lattice structure carrying VertexType for dataflow analysis over path bitsets.
  • EntityPath::origin(), EntityPath::estimate_size(): per-path origin backend and transfer size estimation.
  • TransferCostConfig: variable-size parameters (properties, embeddings, provenance sizes, per-target cost multiplier).
  • FiniteBitSet::negate() in hashql-core.
  • Removed pass/transform/traversal_extraction/ (the MIR transform and its tests).

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

⚠️ Known issues

Path transfer premiums use pure over-approximation: every non-origin backend pays the full premium with no discounting for co-location. This can over-penalize non-origin assignment when multiple blocks access the same path on the same backend (cross-block dedup is not implemented). This is intentional: separable costs are a prerequisite for the PBQP solver planned in BE-436.

The ideal cost model is non-separable: the first block on a backend pays the full data fetch cost, subsequent co-labeled blocks pay zero ("shared-fetch" / pay-once-per-group). This maps to submodular clique costs in the optimization literature. Two frameworks formalize this:

  • Jegelka et al. 2014 (arXiv:1402.0240, Cooperative Graph Cuts): the "label cost" special case is mathematically identical to shared-fetch. Algorithms include polymatroidal flow (exact for separable surrogates) and semigradient methods. However, all are binary-only (k=2 labels).
  • Kolmogorov et al. 2010 (arXiv:1006.1990, Sum of Submodular Functions): general framework via submodular flow with capacity scaling. Also binary-only.

The multi-label extension via alpha-expansion (Boykov, Veksler, Zabih 2001) reduces k-label to a sequence of binary cooperative cuts (each solvable exactly), but only guarantees a local minimum. Our TransMatrix is not metric, so no global approximation factor holds. For k=3 backends (growing to 6-7), the overhead of iterative cooperative cut calls on ~100-node graphs is not justified when PBQP R1/R2 reductions on the separable over-approximation give exact solutions in microseconds.

Pure over-approximation does not distort the relative ranking between non-origin backends (the premium cancels in pairwise comparisons) but inflates the absolute cost of non-origin assignment, biasing toward origin backends. Intra-block dedup (implemented here) is the first mitigation; cross-block dedup remains an open problem for k > 2 on cyclic graphs.
:

🛡 What tests cover this?

  • Unit tests for BasicBlockCostAnalysis covering: no vertex access, single origin/non-origin paths, multiple path accumulation, composite path expansion, restricted target domains, cross-block independence
  • Unit tests for TraversalAnalysisVisitor covering path resolution from MIR projections
  • Unit tests for EntityPathBitSet covering composite swallowing, lattice operations, normalization
  • Existing solver tests updated to use BasicBlockCostVec; new path_premiums_influence_placement and provenance_variants_produce_different_premiums integration tests
  • End-to-end mixed_postgres_embedding_interpreter test verifying three-backend splitting

❓ How to test this?

  1. cargo nextest run --package hashql-mir
  2. cargo test --package hashql-mir --doc

@vercel
Copy link

vercel bot commented Mar 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment Mar 20, 2026 8:19am
petrinaut Ready Ready Preview, Comment Mar 20, 2026 8:19am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign Ignored Ignored Preview Mar 20, 2026 8:19am
hashdotdesign-tokens Ignored Ignored Preview Mar 20, 2026 8:19am

@augmentcode
Copy link

augmentcode bot commented Mar 2, 2026

This pull request is too large for Augment to review. The PR exceeds the maximum size limit of 100000 tokens (approximately 400000 characters) for automated code review. Please consider breaking this PR into smaller, more focused changes.

@github-actions github-actions bot added the area/libs Relates to first-party libraries/crates/packages (area) label Mar 2, 2026
@cursor
Copy link

cursor bot commented Mar 2, 2026

PR Summary

Medium Risk
Updates execution planning and liveness analysis to use new traversal path bitsets and per-block cost aggregation, which can change backend placement decisions and performance characteristics. While covered by tests, it touches core MIR analysis/solver logic and cost modeling.

Overview
Replaces traversal extraction/MIR rewriting with a pure traversal path analysis that records accessed vertex EntityPaths as TraversalPathBitSets, and updates TraversalLivenessAnalysis to track (locals, paths) with the vertex local excluded from local liveness.

Introduces per-basic-block cost modeling via BasicBlockCostAnalysis/BasicBlockCostVec, combining per-statement costs with a transfer premium for non-origin backends based on accessed paths; the placement solver and lower-bound heuristic now operate on these per-block costs.

Refactors execution support code by extracting generic BlockPartitionedVec (used by StatementCostVec), extends island discovery to aggregate traversal paths per island, and adjusts benches/tests/scripts and PostInline::new_in call sites accordingly. Adds const-trait/const-fn upgrades in hashql-core (Id, BitRelations, FiniteBitSet*) including FiniteBitSet::negate() and a new InformationRange::midpoint() helper.

Written by Cursor Bugbot for commit 2346ece. This will update automatically on new commits. Configure here.

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 96.09756% with 88 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.68%. Comparing base (618964d) to head (2346ece).

Files with missing lines Patch % Lines
.../hashql/mir/src/pass/execution/traversal/entity.rs 79.51% 41 Missing and 1 partial ⚠️
...cal/hashql/mir/src/pass/execution/traversal/mod.rs 81.01% 15 Missing ⚠️
libs/@local/hashql/core/src/id/mod.rs 0.00% 9 Missing ⚠️
...ql/mir/src/pass/analysis/dataflow/lattice/impls.rs 90.10% 7 Missing and 2 partials ⚠️
...s/@local/hashql/mir/src/pass/execution/cost/mod.rs 75.00% 5 Missing ⚠️
libs/@local/hashql/core/src/id/bit_vec/mod.rs 85.00% 3 Missing ⚠️
libs/@local/hashql/mir/src/pass/execution/mod.rs 92.00% 1 Missing and 1 partial ⚠️
...hql/mir/src/pass/analysis/dataflow/liveness/mod.rs 96.96% 0 Missing and 1 partial ⚠️
...cal/hashql/mir/src/pass/execution/cost/analysis.rs 99.62% 1 Missing ⚠️
.../mir/src/pass/execution/placement/solve/csp/mod.rs 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8498      +/-   ##
==========================================
+ Coverage   62.60%   62.68%   +0.07%     
==========================================
  Files        1317     1321       +4     
  Lines      133975   134560     +585     
  Branches     5517     5505      -12     
==========================================
+ Hits        83877    84350     +473     
- Misses      49183    49299     +116     
+ Partials      915      911       -4     
Flag Coverage Δ
apps.hash-ai-worker-ts 1.40% <ø> (ø)
apps.hash-api 0.00% <ø> (ø)
local.hash-graph-sdk 9.63% <ø> (ø)
local.hash-isomorphic-utils 0.00% <ø> (ø)
rust.hash-graph-api 2.52% <ø> (ø)
rust.hashql-ast 87.23% <ø> (ø)
rust.hashql-compiletest 29.69% <ø> (ø)
rust.hashql-core 82.35% <91.60%> (+0.06%) ⬆️
rust.hashql-eval 69.13% <ø> (ø)
rust.hashql-hir 89.06% <ø> (ø)
rust.hashql-mir 92.34% <96.40%> (-0.31%) ⬇️
rust.hashql-syntax-jexpr 94.05% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 2, 2026

Merging this PR will not alter performance

✅ 80 untouched benchmarks


Comparing bm/be-428-hashql-simplify-traversal-tracking-to-path-recording (2346ece) with main (1512579)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (618964d) during the generation of this report, so 1512579 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Stale comment and unnecessary reverse after removing traversal costs
    • Removed the unnecessary reverse-order iteration and stale traversal-cost comment so target statement placement now reflects its order-independent behavior.

Create PR

Or push these changes by commenting:

@cursor push 58ca5bc4a4
Preview (58ca5bc4a4)
diff --git a/libs/@local/hashql/mir/src/pass/execution/mod.rs b/libs/@local/hashql/mir/src/pass/execution/mod.rs
--- a/libs/@local/hashql/mir/src/pass/execution/mod.rs
+++ b/libs/@local/hashql/mir/src/pass/execution/mod.rs
@@ -72,10 +72,7 @@
 
         let mut statement_costs: TargetArray<_> = TargetArray::from_fn(|_| None);
 
-        let mut targets = TargetId::all();
-        targets.reverse(); // We reverse the order, so that earlier targets (aka the interpreter) can have access to traversal costs
-
-        for target in targets {
+        for target in TargetId::all() {
             let mut statement = TargetPlacementStatement::new_in(target, &self.scratch);
             let statement_cost =
                 statement.statement_placement_in(context, body, vertex, &self.scratch);
This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

@vercel vercel bot temporarily deployed to Preview – petrinaut March 2, 2026 21:16 Inactive
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Base automatically changed from bm/be-434-hashql-entity-path-resolution-and-storage-mapping to main March 10, 2026 20:41
@indietyp indietyp force-pushed the bm/be-428-hashql-simplify-traversal-tracking-to-path-recording branch from e6439e0 to 2346ece Compare March 20, 2026 08:11
@github-actions
Copy link
Contributor

Benchmark results

@rust/hash-graph-benches – Integrations

policy_resolution_large

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2002 $$26.9 \mathrm{ms} \pm 148 \mathrm{μs}\left({\color{gray}1.36 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.89 \mathrm{ms} \pm 15.5 \mathrm{μs}\left({\color{gray}1.06 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1001 $$12.2 \mathrm{ms} \pm 67.8 \mathrm{μs}\left({\color{gray}-0.272 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$39.9 \mathrm{ms} \pm 287 \mathrm{μs}\left({\color{gray}2.46 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$12.5 \mathrm{ms} \pm 91.1 \mathrm{μs}\left({\color{gray}2.46 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1526 $$22.1 \mathrm{ms} \pm 115 \mathrm{μs}\left({\color{gray}1.73 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$27.6 \mathrm{ms} \pm 155 \mathrm{μs}\left({\color{gray}-0.029 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.18 \mathrm{ms} \pm 13.0 \mathrm{μs}\left({\color{gray}0.609 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$13.1 \mathrm{ms} \pm 69.4 \mathrm{μs}\left({\color{gray}2.01 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.19 \mathrm{ms} \pm 19.1 \mathrm{μs}\left({\color{gray}-0.157 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.45 \mathrm{ms} \pm 8.96 \mathrm{μs}\left({\color{gray}-1.112 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 51 $$2.76 \mathrm{ms} \pm 10.6 \mathrm{μs}\left({\color{gray}-0.924 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$4.52 \mathrm{ms} \pm 21.1 \mathrm{μs}\left({\color{gray}-0.759 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.97 \mathrm{ms} \pm 14.7 \mathrm{μs}\left({\color{gray}-0.401 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 107 $$3.50 \mathrm{ms} \pm 15.5 \mathrm{μs}\left({\color{gray}-1.028 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$3.83 \mathrm{ms} \pm 20.2 \mathrm{μs}\left({\color{gray}1.19 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.87 \mathrm{ms} \pm 13.2 \mathrm{μs}\left({\color{gray}0.142 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$3.50 \mathrm{ms} \pm 19.6 \mathrm{μs}\left({\color{gray}2.23 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.20 \mathrm{ms} \pm 9.04 \mathrm{μs}\left({\color{gray}-0.410 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.17 \mathrm{ms} \pm 10.7 \mathrm{μs}\left({\color{gray}0.514 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1 $$2.27 \mathrm{ms} \pm 10.7 \mathrm{μs}\left({\color{gray}0.068 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.45 \mathrm{ms} \pm 12.1 \mathrm{μs}\left({\color{gray}-0.759 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.33 \mathrm{ms} \pm 9.83 \mathrm{μs}\left({\color{gray}0.398 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.54 \mathrm{ms} \pm 10.8 \mathrm{μs}\left({\color{gray}-0.077 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$2.53 \mathrm{ms} \pm 11.5 \mathrm{μs}\left({\color{gray}0.578 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.28 \mathrm{ms} \pm 11.1 \mathrm{μs}\left({\color{gray}0.792 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 25 $$2.38 \mathrm{ms} \pm 10.6 \mathrm{μs}\left({\color{gray}-0.699 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$2.89 \mathrm{ms} \pm 18.0 \mathrm{μs}\left({\color{gray}0.142 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.47 \mathrm{ms} \pm 8.00 \mathrm{μs}\left({\color{gray}0.343 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 26 $$2.68 \mathrm{ms} \pm 15.2 \mathrm{μs}\left({\color{gray}-0.819 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$2.80 \mathrm{ms} \pm 13.9 \mathrm{μs}\left({\color{gray}0.331 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.48 \mathrm{ms} \pm 12.1 \mathrm{μs}\left({\color{gray}0.744 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$2.72 \mathrm{ms} \pm 14.5 \mathrm{μs}\left({\color{gray}1.72 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$39.9 \mathrm{ms} \pm 159 \mathrm{μs}\left({\color{gray}-0.503 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$78.6 \mathrm{ms} \pm 435 \mathrm{μs}\left({\color{gray}0.419 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$42.6 \mathrm{ms} \pm 168 \mathrm{μs}\left({\color{gray}-4.660 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$47.5 \mathrm{ms} \pm 192 \mathrm{μs}\left({\color{gray}-0.598 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$54.2 \mathrm{ms} \pm 313 \mathrm{μs}\left({\color{gray}-2.074 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$40.4 \mathrm{ms} \pm 180 \mathrm{μs}\left({\color{gray}-2.711 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$430 \mathrm{ms} \pm 852 \mathrm{μs}\left({\color{gray}1.30 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$91.9 \mathrm{ms} \pm 462 \mathrm{μs}\left({\color{gray}0.183 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$92.3 \mathrm{ms} \pm 410 \mathrm{μs}\left({\color{gray}-0.780 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$262 \mathrm{ms} \pm 685 \mathrm{μs}\left({\color{lightgreen}-8.970 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$17.7 \mathrm{ms} \pm 80.5 \mathrm{μs}\left({\color{gray}3.08 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$18.1 \mathrm{ms} \pm 77.8 \mathrm{μs}\left({\color{gray}0.544 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$18.0 \mathrm{ms} \pm 81.0 \mathrm{μs}\left({\color{gray}1.67 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$18.2 \mathrm{ms} \pm 78.6 \mathrm{μs}\left({\color{gray}-0.245 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$21.8 \mathrm{ms} \pm 94.8 \mathrm{μs}\left({\color{gray}-1.664 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$17.3 \mathrm{ms} \pm 91.3 \mathrm{μs}\left({\color{gray}1.50 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$17.4 \mathrm{ms} \pm 95.0 \mathrm{μs}\left({\color{gray}0.919 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$17.1 \mathrm{ms} \pm 84.1 \mathrm{μs}\left({\color{gray}-2.401 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$18.1 \mathrm{ms} \pm 97.7 \mathrm{μs}\left({\color{gray}1.73 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$24.1 \mathrm{ms} \pm 203 \mathrm{μs}\left({\color{gray}-1.285 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity

Function Value Mean Flame graphs
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$31.6 \mathrm{ms} \pm 288 \mathrm{μs}\left({\color{gray}-0.587 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$31.4 \mathrm{ms} \pm 312 \mathrm{μs}\left({\color{gray}-1.112 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$30.8 \mathrm{ms} \pm 293 \mathrm{μs}\left({\color{gray}1.45 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$30.9 \mathrm{ms} \pm 284 \mathrm{μs}\left({\color{gray}-2.551 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$31.2 \mathrm{ms} \pm 270 \mathrm{μs}\left({\color{gray}0.930 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$32.2 \mathrm{ms} \pm 269 \mathrm{μs}\left({\color{gray}3.33 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$33.5 \mathrm{ms} \pm 301 \mathrm{μs}\left({\color{red}9.40 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$31.2 \mathrm{ms} \pm 255 \mathrm{μs}\left({\color{gray}0.398 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$31.2 \mathrm{ms} \pm 295 \mathrm{μs}\left({\color{gray}-3.190 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity_type

Function Value Mean Flame graphs
get_entity_type_by_id Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba $$6.92 \mathrm{ms} \pm 26.4 \mathrm{μs}\left({\color{gray}-1.583 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$95.0 \mathrm{ms} \pm 396 \mathrm{μs}\left({\color{gray}1.79 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$137 \mathrm{ms} \pm 404 \mathrm{μs}\left({\color{gray}0.853 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$101 \mathrm{ms} \pm 390 \mathrm{μs}\left({\color{gray}2.21 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$107 \mathrm{ms} \pm 361 \mathrm{μs}\left({\color{gray}-0.587 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$112 \mathrm{ms} \pm 365 \mathrm{μs}\left({\color{gray}-1.038 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$119 \mathrm{ms} \pm 387 \mathrm{μs}\left({\color{gray}-0.162 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$98.6 \mathrm{ms} \pm 294 \mathrm{μs}\left({\color{gray}0.215 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$121 \mathrm{ms} \pm 567 \mathrm{μs}\left({\color{gray}-0.771 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$105 \mathrm{ms} \pm 475 \mathrm{μs}\left({\color{gray}0.411 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$112 \mathrm{ms} \pm 421 \mathrm{μs}\left({\color{gray}0.369 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$113 \mathrm{ms} \pm 442 \mathrm{μs}\left({\color{gray}-0.137 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$114 \mathrm{ms} \pm 527 \mathrm{μs}\left({\color{gray}0.401 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$124 \mathrm{ms} \pm 477 \mathrm{μs}\left({\color{gray}-3.257 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$132 \mathrm{ms} \pm 445 \mathrm{μs}\left({\color{gray}-3.736 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$90.6 \mathrm{ms} \pm 350 \mathrm{μs}\left({\color{gray}0.883 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$488 \mathrm{ms} \pm 2.27 \mathrm{ms}\left({\color{gray}-1.316 \mathrm{\%}}\right) $$ Flame Graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/libs Relates to first-party libraries/crates/packages (area) area/tests New or updated tests type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

1 participant