Skip to content

BE-494: HashQL: Loop-breaker selection for recursive inlining#8600

Merged
indietyp merged 9 commits into
mainfrom
bm/be-494-hashql-scc-loop-breaker-inlining
May 28, 2026
Merged

BE-494: HashQL: Loop-breaker selection for recursive inlining#8600
indietyp merged 9 commits into
mainfrom
bm/be-494-hashql-scc-loop-breaker-inlining

Conversation

@indietyp
Copy link
Copy Markdown
Member

🌟 What is the purpose of this PR?

This PR implements a three-color depth-first search algorithm for directed graphs and integrates it with a loop-breaker selection system for the MIR inliner. The three-color DFS enables cycle detection and postorder traversal, while the loop-breaker system allows the inliner to handle mutually recursive functions by strategically selecting which functions to avoid inlining within strongly connected components (SCCs).

🔗 Related links

  • Related to MIR optimization and inlining strategies for recursive function groups

🔍 What does this change?

  • Adds a new three-color depth-first search implementation in libs/@local/hashql/core/src/graph/algorithms/color/mod.rs with support for cycle detection and visitor callbacks
  • Implements a loop-breaker selection algorithm in libs/@local/hashql/mir/src/pass/transform/inline/loop_breaker.rs that uses scoring heuristics to choose which functions in recursive SCCs should not be inlined
  • Extends the inline pass to process SCCs with loop-breaker awareness, allowing inlining of non-breaker functions while avoiding infinite recursion
  • Adds comprehensive test coverage for both the three-color DFS algorithm and loop-breaker selection
  • Updates the call graph analysis to support querying callers of a function
  • Adds iterator support for SCC members with both immutable and mutable access
  • Changes unary NOT operator representation from ! to ~ in MIR output formatting
  • Extends inline configuration with InlineLoopBreakerConfig for tuning breaker selection heuristics

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

🛡 What tests cover this?

  • Comprehensive unit tests for three-color DFS including cycle detection, postorder traversal, edge filtering, and state accumulation
  • Loop-breaker selection tests covering mutual recursion, cost-based selection, multi-cycle SCCs, and ordering verification
  • Integration tests showing the complete inlining behavior with loop breakers
  • Existing MIR transformation tests updated to reflect the new unary operator formatting

❓ How to test this?

  1. Run the test suite to verify all three-color DFS and loop-breaker functionality
  2. Test with mutually recursive MIR functions to confirm proper breaker selection and inlining behavior
  3. Verify that the inliner no longer gets stuck in infinite loops when processing recursive function groups

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 31, 2026

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

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment May 28, 2026 1:34pm
petrinaut Ready Ready Preview May 28, 2026 1:34pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign Ignored Ignored Preview May 28, 2026 1:34pm
hashdotdesign-tokens Ignored Ignored Preview May 28, 2026 1:34pm

Copy link
Copy Markdown
Member Author

indietyp commented Mar 31, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 44 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.09%. Comparing base (a8da2f8) to head (cd68cdf).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
...cal/hashql/core/src/graph/algorithms/tarjan/mod.rs 0.00% 22 Missing ⚠️
...shql/mir/src/pass/transform/inline/loop_breaker.rs 90.00% 9 Missing and 4 partials ⚠️
...ocal/hashql/core/src/graph/algorithms/color/mod.rs 93.24% 5 Missing ⚠️
...@local/hashql/mir/src/pass/transform/inline/mod.rs 89.65% 1 Missing and 2 partials ⚠️
...local/hashql/mir/src/pass/transform/inline/find.rs 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8600      +/-   ##
==========================================
+ Coverage   59.04%   59.09%   +0.04%     
==========================================
  Files        1341     1343       +2     
  Lines      129387   129632     +245     
  Branches     5837     5858      +21     
==========================================
+ Hits        76398    76601     +203     
- Misses      52088    52124      +36     
- Partials      901      907       +6     
Flag Coverage Δ
apps.hash-ai-worker-ts 1.41% <ø> (ø)
apps.hash-api 0.00% <ø> (ø)
local.hash-backend-utils 2.81% <ø> (ø)
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 28.26% <ø> (ø)
rust.hashql-core 79.28% <71.87%> (-0.04%) ⬇️
rust.hashql-eval 75.69% <ø> (ø)
rust.hashql-hir 89.06% <ø> (ø)
rust.hashql-mir 86.77% <89.88%> (+0.02%) ⬆️
rust.hashql-syntax-jexpr 94.06% <ø> (ø)

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
Copy Markdown

codspeed-hq Bot commented Mar 31, 2026

Merging this PR will not alter performance

✅ 80 untouched benchmarks


Comparing bm/be-494-hashql-scc-loop-breaker-inlining (cd68cdf) with main (798008c)1

Open in CodSpeed

Footnotes

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

Comment thread libs/@local/hashql/mir/src/pass/transform/inline/tests.rs Fixed
Comment thread libs/@local/hashql/mir/src/pass/transform/inline/tests.rs Fixed
Comment thread libs/@local/hashql/mir/src/pass/transform/inline/tests.rs Fixed
Comment thread libs/@local/hashql/mir/src/pass/transform/inline/tests.rs Fixed
Comment thread libs/@local/hashql/mir/src/pass/transform/inline/tests.rs Fixed
Comment thread libs/@local/hashql/mir/src/pass/transform/inline/tests.rs Fixed
Comment thread libs/@local/hashql/mir/src/pass/transform/inline/tests.rs Fixed
Comment thread libs/@local/hashql/mir/src/pass/transform/inline/tests.rs Fixed
@indietyp indietyp force-pushed the bm/be-482-hashql-remove-logical-not-from-unary-operators branch from 51195eb to d6dbdd5 Compare March 31, 2026 20:56
@indietyp indietyp force-pushed the bm/be-494-hashql-scc-loop-breaker-inlining branch from f66d5ce to b4e6aaf Compare March 31, 2026 20:56
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 31, 2026

Deployment failed with the following error:

Invalid request: `attribution.gitUser` should NOT have additional property `isBot`.

@indietyp indietyp force-pushed the bm/be-494-hashql-scc-loop-breaker-inlining branch 2 times, most recently from 1cba715 to 1da0f0a Compare April 29, 2026 15:42
@indietyp indietyp marked this pull request as ready for review April 29, 2026 15:42
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 29, 2026

PR Summary

Medium Risk
Changes MIR inlining behavior for mutually recursive functions and SCC processing order; incorrect breaker selection could affect codegen size or stability, though heavily tested.

Overview
Adds three-color iterative DFS (TriColorDepthFirstSearch) to hashql_core for back-edge cycle detection, postorder, optional edge filtering, and multi-root traversal via run_from.

Wires that into a new loop-breaker pass for the MIR inline transform: for each non-trivial call-graph SCC, members are scored (cost, callers, leaf/unique-site, inline directives), breakers are chosen greedily until the non-breaker subgraph is acyclic, and SCC member order is rewritten (callees-first postorder, then breakers). The inline pass now skips calls to breakers inside the same SCC (and self-calls) instead of blocking all intra-SCC inlining; aggressive filter inlining drops the old per-caller “already inlined this SCC” matrix in favor of the breaker bitset. CallGraph::callers, Members::iter / iter_mut, and InlineLoopBreakerConfig support the new flow, with unit and insta tests.

Reviewed by Cursor Bugbot for commit cd68cdf. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread libs/@local/hashql/core/src/graph/algorithms/color/mod.rs
Comment thread libs/@local/hashql/core/src/graph/algorithms/color/mod.rs
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 29, 2026

🤖 Augment PR Summary

Summary: Adds loop-breaker-aware inlining for mutually recursive HashQL MIR functions, enabling safe inlining within recursive SCCs without infinite expansion.

Changes:

  • Introduces an iterative three-color DFS utility (with cycle detection and postorder callbacks) in hashql_core::graph::algorithms::color.
  • Adds loop-breaker selection (loop_breaker.rs) that scores SCC members and greedily picks a feedback-vertex set to break recursion.
  • Reorders SCC members so non-breakers are processed in postorder of the breaker-removed DAG, followed by breakers, improving within-SCC optimization ordering.
  • Extends the MIR inliner to inline within SCCs except for self-calls and calls targeting loop breakers.
  • Enhances call graph analysis with a callers(def) iterator and SCC member iteration helpers.
  • Updates MIR formatting/tests to render unary NOT as ~ (instead of !) and refreshes snapshots.
  • Adds substantial unit/integration tests covering breaker selection, multi-breaker SCCs, ordering, and aggressive filter behavior.

Technical Notes: Breaker selection uses repeated cycle checks over the remaining subgraph (filtered via DFS edge ignoring) to ensure the non-breaker remainder is acyclic before allowing within-SCC inlining.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread libs/@local/hashql/mir/src/pass/transform/inline/loop_breaker.rs
Comment thread libs/@local/hashql/mir/src/interpret/tests.rs Outdated
@indietyp indietyp force-pushed the bm/be-482-hashql-remove-logical-not-from-unary-operators branch from 84e917d to d7a892b Compare April 30, 2026 08:53
@indietyp indietyp force-pushed the bm/be-494-hashql-scc-loop-breaker-inlining branch from 979bf1e to 3fe9df4 Compare April 30, 2026 08:53
Comment thread libs/@local/hashql/mir/src/pass/transform/inline/find.rs
Copy link
Copy Markdown

@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.

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit 4ea12a3. Configure here.

Comment thread libs/@local/hashql/mir/src/pass/transform/inline/find.rs
@github-actions
Copy link
Copy Markdown
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.8 \mathrm{ms} \pm 190 \mathrm{μs}\left({\color{lightgreen}-6.312 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.54 \mathrm{ms} \pm 17.6 \mathrm{μs}\left({\color{gray}-2.396 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1001 $$12.2 \mathrm{ms} \pm 76.0 \mathrm{μs}\left({\color{lightgreen}-13.466 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$43.0 \mathrm{ms} \pm 337 \mathrm{μs}\left({\color{gray}-2.356 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$14.7 \mathrm{ms} \pm 105 \mathrm{μs}\left({\color{gray}-2.562 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1526 $$23.3 \mathrm{ms} \pm 177 \mathrm{μs}\left({\color{lightgreen}-7.081 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$27.8 \mathrm{ms} \pm 202 \mathrm{μs}\left({\color{lightgreen}-6.585 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.85 \mathrm{ms} \pm 21.1 \mathrm{μs}\left({\color{gray}-2.580 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$13.1 \mathrm{ms} \pm 77.7 \mathrm{μs}\left({\color{lightgreen}-14.333 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.76 \mathrm{ms} \pm 21.2 \mathrm{μs}\left({\color{gray}-3.820 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.96 \mathrm{ms} \pm 12.6 \mathrm{μs}\left({\color{gray}-4.144 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 51 $$3.34 \mathrm{ms} \pm 17.8 \mathrm{μs}\left({\color{gray}-2.282 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.15 \mathrm{ms} \pm 29.7 \mathrm{μs}\left({\color{gray}-4.292 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.54 \mathrm{ms} \pm 20.5 \mathrm{μs}\left({\color{gray}-2.052 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 107 $$4.13 \mathrm{ms} \pm 22.2 \mathrm{μs}\left({\color{gray}-2.558 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.42 \mathrm{ms} \pm 24.3 \mathrm{μs}\left({\color{gray}-3.285 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.43 \mathrm{ms} \pm 16.8 \mathrm{μs}\left({\color{gray}-3.566 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.11 \mathrm{ms} \pm 25.4 \mathrm{μs}\left({\color{gray}-2.146 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.62 \mathrm{ms} \pm 16.4 \mathrm{μs}\left({\color{lightgreen}-6.117 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.53 \mathrm{ms} \pm 13.4 \mathrm{μs}\left({\color{gray}-3.707 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1 $$2.58 \mathrm{ms} \pm 14.9 \mathrm{μs}\left({\color{lightgreen}-6.911 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.85 \mathrm{ms} \pm 15.9 \mathrm{μs}\left({\color{lightgreen}-5.960 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.65 \mathrm{ms} \pm 14.9 \mathrm{μs}\left({\color{lightgreen}-5.911 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.90 \mathrm{ms} \pm 21.7 \mathrm{μs}\left({\color{gray}-4.950 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.11 \mathrm{ms} \pm 33.7 \mathrm{μs}\left({\color{gray}0.257 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.83 \mathrm{ms} \pm 22.3 \mathrm{μs}\left({\color{gray}-0.872 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 25 $$3.11 \mathrm{ms} \pm 25.8 \mathrm{μs}\left({\color{gray}0.355 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.46 \mathrm{ms} \pm 19.7 \mathrm{μs}\left({\color{gray}-2.487 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.99 \mathrm{ms} \pm 14.3 \mathrm{μs}\left({\color{gray}-2.722 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 26 $$3.30 \mathrm{ms} \pm 22.1 \mathrm{μs}\left({\color{gray}-1.639 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.39 \mathrm{ms} \pm 20.0 \mathrm{μs}\left({\color{gray}-2.894 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.95 \mathrm{ms} \pm 12.7 \mathrm{μs}\left({\color{gray}-4.207 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.32 \mathrm{ms} \pm 16.7 \mathrm{μs}\left({\color{gray}-4.303 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$54.9 \mathrm{ms} \pm 269 \mathrm{μs}\left({\color{lightgreen}-5.794 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$47.0 \mathrm{ms} \pm 276 \mathrm{μs}\left({\color{gray}-1.599 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$52.9 \mathrm{ms} \pm 400 \mathrm{μs}\left({\color{gray}2.10 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$46.9 \mathrm{ms} \pm 266 \mathrm{μs}\left({\color{gray}-2.750 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$64.2 \mathrm{ms} \pm 522 \mathrm{μs}\left({\color{gray}-1.077 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$61.6 \mathrm{ms} \pm 296 \mathrm{μs}\left({\color{gray}-3.742 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$56.2 \mathrm{ms} \pm 266 \mathrm{μs}\left({\color{gray}-2.728 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$108 \mathrm{ms} \pm 714 \mathrm{μs}\left({\color{gray}2.69 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$46.5 \mathrm{ms} \pm 211 \mathrm{μs}\left({\color{gray}-3.597 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$309 \mathrm{ms} \pm 946 \mathrm{μs}\left({\color{gray}2.51 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$19.9 \mathrm{ms} \pm 166 \mathrm{μs}\left({\color{gray}-0.798 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$20.4 \mathrm{ms} \pm 136 \mathrm{μs}\left({\color{gray}-1.552 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$20.3 \mathrm{ms} \pm 119 \mathrm{μs}\left({\color{lightgreen}-5.864 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$19.6 \mathrm{ms} \pm 107 \mathrm{μs}\left({\color{gray}-3.088 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$25.3 \mathrm{ms} \pm 153 \mathrm{μs}\left({\color{lightgreen}-5.069 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$19.3 \mathrm{ms} \pm 205 \mathrm{μs}\left({\color{lightgreen}-5.017 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$19.3 \mathrm{ms} \pm 104 \mathrm{μs}\left({\color{gray}-4.376 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$19.9 \mathrm{ms} \pm 112 \mathrm{μs}\left({\color{gray}-3.353 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$20.9 \mathrm{ms} \pm 109 \mathrm{μs}\left({\color{gray}-0.930 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$27.7 \mathrm{ms} \pm 237 \mathrm{μs}\left({\color{gray}-2.201 \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 $$34.2 \mathrm{ms} \pm 297 \mathrm{μs}\left({\color{lightgreen}-7.505 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$35.9 \mathrm{ms} \pm 360 \mathrm{μs}\left({\color{gray}-3.997 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$33.9 \mathrm{ms} \pm 280 \mathrm{μs}\left({\color{lightgreen}-10.853 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$34.5 \mathrm{ms} \pm 332 \mathrm{μs}\left({\color{lightgreen}-5.696 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$34.4 \mathrm{ms} \pm 301 \mathrm{μs}\left({\color{lightgreen}-13.121 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$34.7 \mathrm{ms} \pm 335 \mathrm{μs}\left({\color{lightgreen}-7.594 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$34.6 \mathrm{ms} \pm 337 \mathrm{μs}\left({\color{lightgreen}-10.311 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$34.7 \mathrm{ms} \pm 331 \mathrm{μs}\left({\color{lightgreen}-10.035 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$33.9 \mathrm{ms} \pm 284 \mathrm{μs}\left({\color{lightgreen}-11.549 \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 $$8.77 \mathrm{ms} \pm 47.6 \mathrm{μs}\left({\color{lightgreen}-6.781 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$94.5 \mathrm{ms} \pm 488 \mathrm{μs}\left({\color{lightgreen}-11.199 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$153 \mathrm{ms} \pm 635 \mathrm{μs}\left({\color{lightgreen}-5.247 \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 588 \mathrm{μs}\left({\color{lightgreen}-9.231 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$114 \mathrm{ms} \pm 846 \mathrm{μs}\left({\color{lightgreen}-8.989 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$119 \mathrm{ms} \pm 602 \mathrm{μs}\left({\color{lightgreen}-8.696 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$128 \mathrm{ms} \pm 534 \mathrm{μs}\left({\color{lightgreen}-7.531 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$105 \mathrm{ms} \pm 581 \mathrm{μs}\left({\color{lightgreen}-5.486 \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 $$132 \mathrm{ms} \pm 576 \mathrm{μs}\left({\color{lightgreen}-8.299 \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 $$112 \mathrm{ms} \pm 640 \mathrm{μs}\left({\color{lightgreen}-5.595 \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 $$119 \mathrm{ms} \pm 542 \mathrm{μs}\left({\color{lightgreen}-8.693 \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 $$121 \mathrm{ms} \pm 619 \mathrm{μs}\left({\color{lightgreen}-6.407 \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 $$120 \mathrm{ms} \pm 506 \mathrm{μs}\left({\color{lightgreen}-7.951 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$132 \mathrm{ms} \pm 630 \mathrm{μs}\left({\color{lightgreen}-13.056 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$145 \mathrm{ms} \pm 594 \mathrm{μs}\left({\color{gray}0.775 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$40.3 \mathrm{ms} \pm 236 \mathrm{μs}\left({\color{lightgreen}-6.199 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$568 \mathrm{ms} \pm 1.11 \mathrm{ms}\left({\color{gray}1.07 \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.

3 participants