Skip to content

BE-523: HashQL: Suspendable interpreter with structured values and input system#8675

Open
indietyp wants to merge 7 commits into
mainfrom
bm/be-523-hashql-suspendable-interpreter-with-structured-values-and
Open

BE-523: HashQL: Suspendable interpreter with structured values and input system#8675
indietyp wants to merge 7 commits into
mainfrom
bm/be-523-hashql-suspendable-interpreter-with-structured-values-and

Conversation

@indietyp
Copy link
Copy Markdown
Member

@indietyp indietyp commented Apr 29, 2026

🌟 What is the purpose of this PR?

Rework the MIR interpreter to support suspend/resume execution, richer value representations, and a proper input system. Together these let the interpreter pause when it needs external data (e.g. a database query), hand back a structured description of what it needs, and resume once the caller provides the result.

🔍 What does this change?

Suspension model (interpret/suspension/)

  • Introduce a suspend/resume protocol: when the interpreter hits a GraphRead terminator it yields a Suspension instead of blocking. Callers drive a start/resume loop until they get a Return.
  • GraphReadSuspension extracts temporal axes, filter parameters, and entity type from the suspended state.
  • Continuation carries the response value that resumes execution.
  • TemporalAxesInterval / Timestamp give structured representations of the temporal query window.
  • Runtime::run convenience wrapper for callers that can fulfill suspensions synchronously.

Input system (interpret/inputs.rs)

  • Add Inputs<'heap, A>: a typed map from interned symbols to Values, consulted for InputOp::Load and InputOp::Exists. Replaces the unstructured FastHashMap previously threaded through the runtime. Supports both global and custom allocators.

Value representation (interpret/value/)

  • Int: carry bit-width (1-bit boolean vs 128-bit integer) so serialization can distinguish true/false from 0/1 without external type info. Arithmetic promotes to 128-bit; bitwise boolean ops preserve 1-bit.
  • Struct: add StructBuilder<N> for stack-allocated fixed-field construction. Enforce sorted field invariant. Add merge and project_by_name.
  • Minor improvements to Opaque, List allocator parameterization, Str display.

SSA repair fix (pass/transform/ssa_repair)

  • Fix block parameters not being renamed during SSA repair.
  • Extend use-before-def detection to terminators, not just statements.

Entity path type resolution (pass/execution/traversal)

  • Add field_path and resolve_type to EntityPath for navigating from an entity path (e.g. WebId, Properties) to its concrete stdlib type.

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

None

🐾 Next steps

  • The orchestrator in hashql-eval consumes the suspension model and input system introduced here.

🛡 What tests cover this?

  • Interpreter unit tests (interpret/tests.rs): cover the suspend/resume loop, input resolution, and value operations.
  • SSA repair UI tests (tests/ui/pass/ssa_repair): cover the block parameter and terminator fixes.
  • Existing pass UI tests re-blessed for snapshot changes from the Int representation change.

❓ How to test this?

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

feat: make Int size aware

feat: postgres serialization

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: errors

feat: psql codec

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: move bridge -> orchestrator

feat: move bridge -> orchestrator

feat: organize the runtime a bit more

feat: organize the runtime a bit more

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: organize the runtime a bit more

feat: finish orchestrator first version

feat: finish orchestrator first version

feat: feat: move out suspension requests to own module

chore: clippy

feat: split out into more manageable functions

feat: split out into more manageable functions

chore: orchestrator docs

feat: organize the runtime a bit more

feat: test orchestrator

feat: better symbol repr

feat: orchestrator test harness

feat: orchestrator test harness

feat: orchestrator test harness

feat: orchestrator test harness

feat: orchestrator test harness

feat: test orchestrator

feat: pipeline

feat: bless snapshots

chore: tests

chore: masking

chore: tests

fix: SSA repair

chiore: ssa repair snapshots

feat: orchestrator test harness

chore: remove spec

fix: library features

chore: update snapshots

chore: update docs
@vercel vercel Bot temporarily deployed to Preview – petrinaut April 29, 2026 14:14 Inactive
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 29, 2026

PR Summary

High Risk
High risk because it substantially refactors the interpreter runtime API and execution model (new yield/suspension/continuation flow) and changes core value semantics (Int now tracks bool vs integer width), which can affect query execution and serialized results.

Overview
Adds a suspend/resume execution protocol to the MIR interpreter: GraphRead no longer unimplemented!(); execution now yields Yield::{Return,Suspension} with new Suspension/Continuation types and Runtime::{start,resume,run_until_suspension,run_until_transition} APIs, plus expanded diagnostics to categorize suspension-related failures.

Replaces ad-hoc input plumbing and adjusts runtime/value internals: introduces Inputs as the runtime input container (passed by reference), updates benches/tests accordingly, and expands interpreter error/value handling (new RuntimeError variants, projection through Opaque, StructBuilder, Str debug, list indexing conversion). Separately, Int is redesigned to track 1-bit booleans vs 128-bit integers, updating Postgres eval constant compilation and rebasing UI snapshots from 0/1 to false/true where appropriate.

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

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

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

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment May 19, 2026 3:53pm
petrinaut Ready Ready Preview May 19, 2026 3:53pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview May 19, 2026 3:53pm

@github-actions github-actions Bot added area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team area/tests New or updated tests labels Apr 29, 2026
@indietyp indietyp changed the title HashQL: Suspendable interpreter with structured values and input system BE-523: HashQL: Suspendable interpreter with structured values and input system Apr 29, 2026
Copy link
Copy Markdown
Member Author

indietyp commented Apr 29, 2026

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 78.51750% with 313 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.90%. Comparing base (56860d0) to head (43cd799).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
.../hashql/mir/src/pass/execution/traversal/entity.rs 0.00% 66 Missing ⚠️
libs/@local/hashql/mir/src/interpret/error.rs 11.42% 62 Missing ⚠️
.../hashql/mir/src/interpret/suspension/graph_read.rs 47.19% 40 Missing and 7 partials ⚠️
libs/@local/hashql/mir/src/interpret/runtime.rs 79.25% 38 Missing and 1 partial ⚠️
libs/@local/hashql/mir/src/interpret/value/int.rs 91.96% 14 Missing and 6 partials ⚠️
libs/@local/hashql/mir/src/interpret/value/mod.rs 67.27% 18 Missing ⚠️
libs/@local/hashql/mir/src/interpret/inputs.rs 63.04% 17 Missing ⚠️
libs/@local/hashql/mir/src/interpret/tests.rs 96.08% 7 Missing and 7 partials ⚠️
...bs/@local/hashql/mir/src/interpret/value/struct.rs 96.15% 5 Missing and 2 partials ⚠️
...bs/@local/hashql/mir/src/interpret/value/opaque.rs 0.00% 5 Missing ⚠️
... and 7 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8675      +/-   ##
==========================================
+ Coverage   62.72%   62.90%   +0.17%     
==========================================
  Files        1363     1369       +6     
  Lines      139062   140714    +1652     
  Branches     5818     5833      +15     
==========================================
+ Hits        87225    88510    +1285     
- Misses      50921    51273     +352     
- Partials      916      931      +15     
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 29.63% <ø> (ø)
rust.hashql-core 82.17% <ø> (-0.27%) ⬇️
rust.hashql-diagnostics 72.53% <100.00%> (+0.09%) ⬆️
rust.hashql-eval 81.08% <0.00%> (ø)
rust.hashql-hir 89.06% <ø> (ø)
rust.hashql-mir 91.58% <78.48%> (-0.51%) ⬇️
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.

@vercel vercel Bot temporarily deployed to Preview – petrinaut April 29, 2026 14:18 Inactive
@indietyp indietyp force-pushed the bm/be-523-hashql-suspendable-interpreter-with-structured-values-and branch from 7be336d to e2fda5b Compare May 11, 2026 10:58
@indietyp indietyp force-pushed the bm/be-522-hashql-expand-stdlib-type-definitions branch from 3cb3bf5 to dd10bcf Compare May 12, 2026 13:58
@indietyp indietyp force-pushed the bm/be-523-hashql-suspendable-interpreter-with-structured-values-and branch from e2fda5b to 50368b6 Compare May 12, 2026 13:58
@indietyp indietyp force-pushed the bm/be-522-hashql-expand-stdlib-type-definitions branch from dd10bcf to ffd9997 Compare May 13, 2026 09:38
@indietyp indietyp force-pushed the bm/be-523-hashql-suspendable-interpreter-with-structured-values-and branch from 50368b6 to 6499ac2 Compare May 13, 2026 09:38
@indietyp indietyp force-pushed the bm/be-523-hashql-suspendable-interpreter-with-structured-values-and branch from 6499ac2 to d005e5a Compare May 13, 2026 09:57
@indietyp indietyp force-pushed the bm/be-522-hashql-expand-stdlib-type-definitions branch from 89ae7c2 to 9047680 Compare May 15, 2026 07:49
@indietyp indietyp force-pushed the bm/be-523-hashql-suspendable-interpreter-with-structured-values-and branch from d005e5a to 4082a24 Compare May 15, 2026 07:49
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 4082a24. Configure here.

Comment thread libs/@local/hashql/mir/src/interpret/tests.rs
@graphite-app graphite-app Bot changed the base branch from bm/be-522-hashql-expand-stdlib-type-definitions to graphite-base/8675 May 18, 2026 08:45
@indietyp indietyp force-pushed the graphite-base/8675 branch from 9047680 to a474018 Compare May 19, 2026 15:43
@indietyp indietyp force-pushed the bm/be-523-hashql-suspendable-interpreter-with-structured-values-and branch from 4082a24 to 43cd799 Compare May 19, 2026 15:43
@indietyp indietyp changed the base branch from graphite-base/8675 to main May 19, 2026 15:43
@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 $$27.2 \mathrm{ms} \pm 205 \mathrm{μs}\left({\color{gray}0.011 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.62 \mathrm{ms} \pm 18.0 \mathrm{μs}\left({\color{gray}3.00 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1001 $$13.1 \mathrm{ms} \pm 109 \mathrm{μs}\left({\color{gray}-2.018 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$46.0 \mathrm{ms} \pm 330 \mathrm{μs}\left({\color{gray}2.57 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$15.8 \mathrm{ms} \pm 136 \mathrm{μs}\left({\color{gray}3.97 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1526 $$25.4 \mathrm{ms} \pm 197 \mathrm{μs}\left({\color{gray}-0.847 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$28.5 \mathrm{ms} \pm 139 \mathrm{μs}\left({\color{gray}0.814 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$4.01 \mathrm{ms} \pm 23.5 \mathrm{μs}\left({\color{gray}3.63 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$14.6 \mathrm{ms} \pm 127 \mathrm{μs}\left({\color{gray}0.145 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.80 \mathrm{ms} \pm 21.9 \mathrm{μs}\left({\color{gray}-0.915 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.06 \mathrm{ms} \pm 16.7 \mathrm{μs}\left({\color{gray}-2.308 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 51 $$3.40 \mathrm{ms} \pm 22.6 \mathrm{μs}\left({\color{gray}-0.988 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.14 \mathrm{ms} \pm 25.0 \mathrm{μs}\left({\color{gray}-2.349 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.63 \mathrm{ms} \pm 29.1 \mathrm{μs}\left({\color{gray}-0.375 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 107 $$4.13 \mathrm{ms} \pm 25.2 \mathrm{μs}\left({\color{gray}-3.114 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.57 \mathrm{ms} \pm 42.6 \mathrm{μs}\left({\color{gray}3.27 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.45 \mathrm{ms} \pm 15.5 \mathrm{μs}\left({\color{gray}-1.916 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.21 \mathrm{ms} \pm 41.0 \mathrm{μs}\left({\color{gray}-0.587 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.80 \mathrm{ms} \pm 12.8 \mathrm{μs}\left({\color{gray}0.832 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.81 \mathrm{ms} \pm 12.5 \mathrm{μs}\left({\color{gray}2.73 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1 $$2.92 \mathrm{ms} \pm 14.3 \mathrm{μs}\left({\color{gray}1.16 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$3.17 \mathrm{ms} \pm 16.9 \mathrm{μs}\left({\color{gray}1.46 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.98 \mathrm{ms} \pm 13.9 \mathrm{μs}\left({\color{gray}0.981 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$3.22 \mathrm{ms} \pm 13.7 \mathrm{μs}\left({\color{gray}-0.765 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.09 \mathrm{ms} \pm 16.2 \mathrm{μs}\left({\color{lightgreen}-5.145 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.80 \mathrm{ms} \pm 16.8 \mathrm{μs}\left({\color{lightgreen}-12.213 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 25 $$2.93 \mathrm{ms} \pm 15.7 \mathrm{μs}\left({\color{lightgreen}-8.472 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.55 \mathrm{ms} \pm 22.7 \mathrm{μs}\left({\color{lightgreen}-5.886 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.19 \mathrm{ms} \pm 22.3 \mathrm{μs}\left({\color{gray}-3.800 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 26 $$3.36 \mathrm{ms} \pm 20.7 \mathrm{μs}\left({\color{lightgreen}-5.713 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.45 \mathrm{ms} \pm 23.9 \mathrm{μs}\left({\color{gray}-1.067 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.10 \mathrm{ms} \pm 17.9 \mathrm{μs}\left({\color{gray}-2.790 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.36 \mathrm{ms} \pm 26.8 \mathrm{μs}\left({\color{gray}-2.005 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$46.5 \mathrm{ms} \pm 208 \mathrm{μs}\left({\color{lightgreen}-5.922 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$83.6 \mathrm{ms} \pm 354 \mathrm{μs}\left({\color{gray}-4.993 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$50.9 \mathrm{ms} \pm 281 \mathrm{μs}\left({\color{lightgreen}-8.094 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$54.6 \mathrm{ms} \pm 463 \mathrm{μs}\left({\color{gray}-0.812 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$65.4 \mathrm{ms} \pm 345 \mathrm{μs}\left({\color{gray}-1.098 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$47.2 \mathrm{ms} \pm 184 \mathrm{μs}\left({\color{gray}-1.863 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$412 \mathrm{ms} \pm 721 \mathrm{μs}\left({\color{gray}-1.805 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$103 \mathrm{ms} \pm 504 \mathrm{μs}\left({\color{gray}-2.136 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$85.3 \mathrm{ms} \pm 342 \mathrm{μs}\left({\color{gray}-1.908 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$320 \mathrm{ms} \pm 598 \mathrm{μs}\left({\color{gray}-4.267 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$19.5 \mathrm{ms} \pm 75.8 \mathrm{μs}\left({\color{gray}-3.637 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$20.7 \mathrm{ms} \pm 106 \mathrm{μs}\left({\color{gray}-1.917 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$20.5 \mathrm{ms} \pm 101 \mathrm{μs}\left({\color{gray}-1.770 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$20.6 \mathrm{ms} \pm 97.7 \mathrm{μs}\left({\color{gray}-1.467 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$24.8 \mathrm{ms} \pm 85.0 \mathrm{μs}\left({\color{gray}-2.998 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$19.8 \mathrm{ms} \pm 104 \mathrm{μs}\left({\color{gray}-2.497 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$19.7 \mathrm{ms} \pm 90.5 \mathrm{μs}\left({\color{gray}-1.156 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$19.8 \mathrm{ms} \pm 100 \mathrm{μs}\left({\color{gray}-2.656 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$20.3 \mathrm{ms} \pm 86.1 \mathrm{μs}\left({\color{gray}-2.597 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$26.9 \mathrm{ms} \pm 232 \mathrm{μs}\left({\color{gray}-1.902 \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 $$36.3 \mathrm{ms} \pm 308 \mathrm{μs}\left({\color{gray}-4.255 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$34.9 \mathrm{ms} \pm 282 \mathrm{μs}\left({\color{lightgreen}-8.026 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$35.6 \mathrm{ms} \pm 286 \mathrm{μs}\left({\color{lightgreen}-10.716 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$34.2 \mathrm{ms} \pm 285 \mathrm{μs}\left({\color{lightgreen}-9.425 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$35.5 \mathrm{ms} \pm 272 \mathrm{μs}\left({\color{gray}-2.147 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$35.9 \mathrm{ms} \pm 277 \mathrm{μs}\left({\color{gray}-1.992 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$33.4 \mathrm{ms} \pm 271 \mathrm{μs}\left({\color{lightgreen}-11.043 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$35.7 \mathrm{ms} \pm 305 \mathrm{μs}\left({\color{gray}-2.300 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$35.6 \mathrm{ms} \pm 275 \mathrm{μs}\left({\color{lightgreen}-5.217 \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.34 \mathrm{ms} \pm 39.3 \mathrm{μs}\left({\color{lightgreen}-6.988 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$94.2 \mathrm{ms} \pm 482 \mathrm{μs}\left({\color{lightgreen}-10.094 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$148 \mathrm{ms} \pm 628 \mathrm{μs}\left({\color{lightgreen}-9.678 \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 473 \mathrm{μs}\left({\color{lightgreen}-7.892 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$108 \mathrm{ms} \pm 495 \mathrm{μs}\left({\color{lightgreen}-10.136 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$117 \mathrm{ms} \pm 624 \mathrm{μs}\left({\color{lightgreen}-9.876 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$130 \mathrm{ms} \pm 584 \mathrm{μs}\left({\color{lightgreen}-5.201 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$101 \mathrm{ms} \pm 350 \mathrm{μs}\left({\color{lightgreen}-9.925 \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 $$129 \mathrm{ms} \pm 468 \mathrm{μs}\left({\color{lightgreen}-9.360 \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 $$108 \mathrm{ms} \pm 452 \mathrm{μs}\left({\color{lightgreen}-8.626 \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 $$118 \mathrm{ms} \pm 447 \mathrm{μs}\left({\color{lightgreen}-8.955 \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 $$120 \mathrm{ms} \pm 561 \mathrm{μs}\left({\color{lightgreen}-7.542 \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 374 \mathrm{μs}\left({\color{lightgreen}-7.552 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$144 \mathrm{ms} \pm 558 \mathrm{μs}\left({\color{red}6.21 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$152 \mathrm{ms} \pm 584 \mathrm{μs}\left({\color{gray}2.72 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$109 \mathrm{ms} \pm 643 \mathrm{μs}\left({\color{red}83.9 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$592 \mathrm{ms} \pm 3.24 \mathrm{ms}\left({\color{gray}3.26 \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.

2 participants