Skip to content

BE-587, BE-588: HashQL: Introduce CodeGenerationContext/CodeExecutionContext split and eval-stage Interner#8839

Open
indietyp wants to merge 8 commits into
mainfrom
bm/be-587-hashql-eval-interner-and-context-restructuring
Open

BE-587, BE-588: HashQL: Introduce CodeGenerationContext/CodeExecutionContext split and eval-stage Interner#8839
indietyp wants to merge 8 commits into
mainfrom
bm/be-587-hashql-eval-interner-and-context-restructuring

Conversation

@indietyp

@indietyp indietyp commented Jun 8, 2026

Copy link
Copy Markdown
Member

🌟 What is the purpose of this PR?

This PR refactors the HashQL evaluation pipeline to introduce a cleaner separation between the code generation phase and the code execution phase. The previously unified EvalContext is split into CodeGenerationContext (used during MIR compilation and Postgres query preparation) and CodeExecutionContext (used during orchestrated query execution). This makes the data flow and lifecycle of each phase explicit and prevents accidental misuse of context across phase boundaries.

Additionally, a dedicated eval::intern::Interner is introduced for the evaluation stage, which must be constructed from the MIR interner via From to preserve interned pointer identity across the MIR/eval boundary. Input construction for orchestrator tests is also migrated away from using the JSON decoder to directly building typed Value trees using the heap allocator, removing a dependency on the type environment at input-construction time.

The compile_query implementation in the graph API is stubbed out with unimplemented! pending the HashQL API wire-up tracked in BE-537.

🔗 Related links

🔍 What does this change?

  • Renames EvalContext to CodeGenerationContext and introduces a new CodeExecutionContext struct that is produced from CodeGenerationContext via From, carrying only the fields needed at execution time.
  • Adds eval::intern::Interner as a dedicated interner for the evaluation stage, constructed from hashql_mir::intern::Interner to preserve pointer identity.
  • Updates Orchestrator and PostgresCompiler to use the appropriate context type for their respective phases.
  • Replaces JSON-decoder-based input construction in orchestrator tests with direct Value tree construction using heap-allocated Rc and StructBuilder, removing the dependency on the post-lowering type environment for building inputs.
  • Stubs out EntityQuery::compile_query with unimplemented! and suppresses dead_code warnings pending the full HashQL API integration.
  • Updates the EvalDiagnosticCategory enum to replace the graph-feature-gated Graph variant with an Orchestrator variant backed by OrchestratorDiagnosticCategory.
  • Migrates orchestrator test helpers to pass Lowered by value (consuming it) and convert the MIR interner into the eval interner at the appropriate pipeline stage.

🛡 What tests cover this?

  • Existing orchestrator integration tests and eval_postgres compile tests exercise the refactored context types and input construction.
  • Decoder unit tests updated to use Interner::testing for the new eval-stage interner.

❓ How to test this?

  1. Run cargo test across the hashql-eval and hash-graph-api crates.
  2. Run the orchestrator integration tests to confirm query execution still produces correct results against a live Postgres instance.

indietyp added 3 commits June 8, 2026 12:32
chore: add new dependency

chore: format

feat: error module

feat: introduce hashql_eval interner

chore: checkpoint

feat: checkpoint

feat: checkpoint

chore: remove old value module

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

chore: checkpoint

feat: move entity query into its own modul

fix: query request

feat: checkpoint (it compiles!)

feat: checkpoint

feat: checkpoint

feat: checkpoint

fix: issue around cached thunking

feat: covariance for opaque inners

fix: cfgattr serde

chore: remove graph module

fix: merge fuckup
Copilot AI review requested due to automatic review settings June 8, 2026 11:41
@cursor

cursor Bot commented Jun 8, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Raw HashQL query entity/subgraph requests are broken until BE-537; eval/orchestrator wiring and allocator changes touch the main query execution path.

Overview
Refactors the HashQL eval pipeline so Postgres compilation and orchestrated execution use distinct context types, and temporarily disables in-API compilation of raw HashQL entity queries.

EvalContext is renamed to CodeGenerationContext (live-out analysis, diagnostics, allocator) and CodeExecutionContext is added for the orchestrator with only env, interner, bodies, execution residuals, and alloc. Execution context is produced via From after codegen finishes.

A new hashql_eval::intern::Interner is introduced and must be built from the MIR interner so symbol interning stays pointer-identical across the MIR/eval boundary; decoders, partial hydration, and Postgres compilers now take this type instead of hashql_mir::intern::Interner.

EvalDiagnosticCategory drops the feature-gated Graph variant in favor of Orchestrator.

In entity_query_request, the full AST→HIR→graph-read compile path for EntityQuery::Query is removed; those requests now return 501 NOT_IMPLEMENTED with a BE-537 link (filter queries unchanged).

Orchestrator integration tests build interpreter Inputs by constructing opaque Value trees on the heap (and use run_in with the heap allocator) instead of type-environment JSON decoding.

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

@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment Jun 30, 2026 12:57pm
petrinaut Ready Ready Preview Jun 30, 2026 12:57pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Jun 30, 2026 12:57pm

indietyp commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 8af8844. Configure here.

Comment thread libs/@local/hashql/eval/tests/orchestrator/inputs.rs
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.88889% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.60%. Comparing base (b8971f3) to head (09c9fa2).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
libs/@local/hashql/eval/src/context.rs 52.94% 8 Missing ⚠️
.../@local/graph/api/src/rest/entity_query_request.rs 0.00% 4 Missing ⚠️
libs/@local/hashql/eval/src/error.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8839      +/-   ##
==========================================
+ Coverage   59.57%   59.60%   +0.03%     
==========================================
  Files        1366     1367       +1     
  Lines      132760   132685      -75     
  Branches     6045     6044       -1     
==========================================
- Hits        79094    79090       -4     
+ Misses      52732    52661      -71     
  Partials      934      934              
Flag Coverage Δ
apps.hash-ai-worker-ts 1.39% <ø> (ø)
apps.hash-api 6.39% <ø> (ø)
local.hash-backend-utils 2.81% <ø> (ø)
local.hash-graph-sdk 10.00% <ø> (ø)
local.hash-isomorphic-utils 0.18% <ø> (ø)
rust.hash-graph-api 2.54% <0.00%> (+0.04%) ⬆️
rust.hashql-compiletest 28.40% <ø> (+0.15%) ⬆️
rust.hashql-eval 74.97% <71.87%> (-0.27%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

@indietyp indietyp changed the title BE-587: HashQL: Introduce CodeGenerationContext/CodeExecutionContext split and eval-stage Interner BE-587, BE-588: HashQL: Introduce CodeGenerationContext/CodeExecutionContext split and eval-stage Interner Jun 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Refactors the HashQL evaluation pipeline to explicitly separate code-generation vs code-execution concerns by splitting the former EvalContext into CodeGenerationContext and CodeExecutionContext, and introduces an eval-stage intern::Interner to preserve interned pointer identity across the MIR → eval boundary. Test harnesses and orchestrator utilities are updated to construct typed Value inputs directly (without the JSON decoder/type-env dependency) and to pass the appropriate context/interner types through the compilation/execution stages.

Changes:

  • Split evaluation context into generation/execution contexts and updated Postgres compilation + orchestrator execution call sites accordingly.
  • Added eval-stage intern::Interner (convertible from MIR interner) and migrated decoder/tests to use it.
  • Reworked orchestrator test input construction to build heap-allocated typed Value trees directly; graph API compile_query was stubbed pending BE-537.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
libs/@local/hashql/eval/tests/orchestrator/output.rs Generalized success rendering to support non-Global value allocators.
libs/@local/hashql/eval/tests/orchestrator/main.rs Updated test driver to consume lowered artifacts and pass symbol intern sets into input builder.
libs/@local/hashql/eval/tests/orchestrator/inputs.rs Replaced JSON-decoder-based input construction with direct typed Value construction using heap allocation + struct builders.
libs/@local/hashql/eval/tests/orchestrator/execution.rs Updated lowering/execution glue to use MIR interner → eval interner conversion and the new context split; switched to Orchestrator::run_in.
libs/@local/hashql/eval/src/postgres/projections.rs Added #[inline] on a conversion impl.
libs/@local/hashql/eval/src/postgres/parameters.rs Added #[inline] on a conversion impl.
libs/@local/hashql/eval/src/postgres/mod.rs Switched compiler context type to CodeGenerationContext and updated docs accordingly.
libs/@local/hashql/eval/src/postgres/filter/tests.rs Migrated tests to CodeGenerationContext and eval-stage test interner helper.
libs/@local/hashql/eval/src/postgres/filter/mod.rs Updated filter compiler to reference CodeGenerationContext.
libs/@local/hashql/eval/src/orchestrator/partial.rs Switched to eval-stage Interner in hydration pipeline.
libs/@local/hashql/eval/src/orchestrator/mod.rs Updated orchestrator to depend on CodeExecutionContext; added allocator-parametric run_in usage in call sites.
libs/@local/hashql/eval/src/orchestrator/events.rs Added #[inline] on Default impl.
libs/@local/hashql/eval/src/orchestrator/codec/decode/tests.rs Updated decoder tests to use eval-stage Interner::testing.
libs/@local/hashql/eval/src/orchestrator/codec/decode/mod.rs Switched decoder interner reference to the eval-stage interner.
libs/@local/hashql/eval/src/lib.rs Exported new intern module.
libs/@local/hashql/eval/src/intern.rs Introduced eval-stage Interner convertible from MIR interner (preserves interned identity).
libs/@local/hashql/eval/src/error.rs Replaced graph-gated diagnostic category variant with an orchestrator-backed variant.
libs/@local/hashql/eval/src/context.rs Implemented CodeGenerationContext / CodeExecutionContext split and From conversion.
libs/@local/hashql/core/src/graph/linked.rs Minor Debug impl formatting cleanup + added #[inline] on accessors.
libs/@local/hashql/compiletest/src/suite/eval_postgres.rs Updated compiletest suite to use CodeGenerationContext and eval interner conversion.
libs/@local/graph/api/src/rest/entity_query_request.rs Added lint expectation and stubbed compile_query while HashQL API wiring is pending BE-537.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/@local/hashql/eval/tests/orchestrator/inputs.rs
Comment thread libs/@local/graph/api/src/rest/entity_query_request.rs Outdated
@codspeed-hq

codspeed-hq Bot commented Jun 8, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 15.38%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 2 regressed benchmarks
✅ 78 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
bit_matrix/dense/iter_row[64] 140.8 ns 170 ns -17.16%
bit_matrix/dense/iter_row[200] 185.8 ns 215 ns -13.57%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing bm/be-587-hashql-eval-interner-and-context-restructuring (09c9fa2) with main (7f74e1c)

Open in CodSpeed

@indietyp indietyp force-pushed the bm/be-581-hashql-cached-constructor-produces-bare-fnptr-instead-of branch from 74f8c73 to a203514 Compare June 8, 2026 11:55
@indietyp indietyp force-pushed the bm/be-587-hashql-eval-interner-and-context-restructuring branch from 8af8844 to 82bb954 Compare June 8, 2026 11:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Comment thread libs/@local/hashql/eval/tests/orchestrator/execution.rs
Comment thread libs/@local/graph/api/src/rest/entity_query_request.rs
@indietyp indietyp force-pushed the bm/be-581-hashql-cached-constructor-produces-bare-fnptr-instead-of branch from 79c6226 to 610b509 Compare June 22, 2026 10:51
@indietyp indietyp force-pushed the bm/be-587-hashql-eval-interner-and-context-restructuring branch from 233e8eb to 0f62210 Compare June 22, 2026 10:51
Copilot AI review requested due to automatic review settings June 22, 2026 12:02
@indietyp indietyp force-pushed the bm/be-587-hashql-eval-interner-and-context-restructuring branch from 0f62210 to e9a1230 Compare June 22, 2026 12:02
@indietyp indietyp force-pushed the bm/be-581-hashql-cached-constructor-produces-bare-fnptr-instead-of branch from 610b509 to 5bc1aaa Compare June 22, 2026 12:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.

Comment thread libs/@local/hashql/eval/tests/orchestrator/execution.rs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.

Comment thread libs/@local/hashql/eval/tests/orchestrator/execution.rs

@thehabbos007 thehabbos007 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me, I think it would be nice for Tim to take a look too as it touches the graph api

@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.7 \mathrm{ms} \pm 205 \mathrm{μs}\left({\color{gray}0.880 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.45 \mathrm{ms} \pm 21.9 \mathrm{μs}\left({\color{gray}0.520 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1002 $$13.3 \mathrm{ms} \pm 128 \mathrm{μs}\left({\color{red}6.70 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$43.6 \mathrm{ms} \pm 404 \mathrm{μs}\left({\color{gray}0.323 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$14.6 \mathrm{ms} \pm 160 \mathrm{μs}\left({\color{gray}2.61 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1527 $$24.4 \mathrm{ms} \pm 203 \mathrm{μs}\left({\color{gray}1.77 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$28.8 \mathrm{ms} \pm 224 \mathrm{μs}\left({\color{gray}1.44 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.74 \mathrm{ms} \pm 24.7 \mathrm{μs}\left({\color{gray}0.005 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$14.0 \mathrm{ms} \pm 111 \mathrm{μs}\left({\color{gray}3.23 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.84 \mathrm{ms} \pm 26.7 \mathrm{μs}\left({\color{gray}1.25 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.02 \mathrm{ms} \pm 16.5 \mathrm{μs}\left({\color{gray}0.325 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 52 $$3.39 \mathrm{ms} \pm 19.7 \mathrm{μs}\left({\color{gray}0.503 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.27 \mathrm{ms} \pm 35.0 \mathrm{μs}\left({\color{gray}1.21 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.59 \mathrm{ms} \pm 26.8 \mathrm{μs}\left({\color{gray}0.270 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 108 $$4.20 \mathrm{ms} \pm 31.4 \mathrm{μs}\left({\color{gray}0.227 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.44 \mathrm{ms} \pm 31.7 \mathrm{μs}\left({\color{gray}-0.224 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.49 \mathrm{ms} \pm 20.8 \mathrm{μs}\left({\color{gray}0.729 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.11 \mathrm{ms} \pm 29.1 \mathrm{μs}\left({\color{gray}0.037 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.70 \mathrm{ms} \pm 16.0 \mathrm{μs}\left({\color{gray}2.30 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.53 \mathrm{ms} \pm 16.6 \mathrm{μs}\left({\color{gray}-0.511 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 2 $$2.67 \mathrm{ms} \pm 16.1 \mathrm{μs}\left({\color{gray}2.64 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.96 \mathrm{ms} \pm 18.8 \mathrm{μs}\left({\color{gray}2.85 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.76 \mathrm{ms} \pm 18.2 \mathrm{μs}\left({\color{gray}3.67 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.98 \mathrm{ms} \pm 26.4 \mathrm{μs}\left({\color{gray}4.51 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.08 \mathrm{ms} \pm 24.9 \mathrm{μs}\left({\color{gray}-0.241 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.78 \mathrm{ms} \pm 18.4 \mathrm{μs}\left({\color{gray}0.955 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 26 $$3.00 \mathrm{ms} \pm 16.7 \mathrm{μs}\left({\color{gray}1.88 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.47 \mathrm{ms} \pm 23.9 \mathrm{μs}\left({\color{gray}0.025 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.02 \mathrm{ms} \pm 18.5 \mathrm{μs}\left({\color{gray}0.181 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 27 $$3.31 \mathrm{ms} \pm 21.0 \mathrm{μs}\left({\color{gray}2.23 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.45 \mathrm{ms} \pm 27.5 \mathrm{μs}\left({\color{gray}1.39 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.96 \mathrm{ms} \pm 16.9 \mathrm{μs}\left({\color{gray}-0.724 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.35 \mathrm{ms} \pm 21.9 \mathrm{μs}\left({\color{gray}2.00 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$42.0 \mathrm{ms} \pm 215 \mathrm{μs}\left({\color{gray}0.690 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$32.7 \mathrm{ms} \pm 172 \mathrm{μs}\left({\color{gray}-2.043 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$35.7 \mathrm{ms} \pm 241 \mathrm{μs}\left({\color{gray}0.817 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$44.9 \mathrm{ms} \pm 1.51 \mathrm{ms}\left({\color{red}43.1 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$42.1 \mathrm{ms} \pm 250 \mathrm{μs}\left({\color{gray}0.533 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$49.4 \mathrm{ms} \pm 305 \mathrm{μs}\left({\color{gray}0.578 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$40.7 \mathrm{ms} \pm 236 \mathrm{μs}\left({\color{gray}1.57 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$93.5 \mathrm{ms} \pm 686 \mathrm{μs}\left({\color{gray}1.81 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$44.0 \mathrm{ms} \pm 3.55 \mathrm{ms}\left({\color{red}32.4 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$259 \mathrm{ms} \pm 967 \mathrm{μs}\left({\color{gray}-0.301 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$10.6 \mathrm{ms} \pm 69.6 \mathrm{μs}\left({\color{gray}-1.628 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$10.7 \mathrm{ms} \pm 68.2 \mathrm{μs}\left({\color{gray}0.077 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$10.7 \mathrm{ms} \pm 70.3 \mathrm{μs}\left({\color{gray}-1.612 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$10.6 \mathrm{ms} \pm 66.3 \mathrm{μs}\left({\color{gray}-0.540 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$10.8 \mathrm{ms} \pm 58.7 \mathrm{μs}\left({\color{gray}-0.088 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$10.6 \mathrm{ms} \pm 61.0 \mathrm{μs}\left({\color{gray}0.019 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$10.6 \mathrm{ms} \pm 75.7 \mathrm{μs}\left({\color{gray}0.207 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$10.6 \mathrm{ms} \pm 53.6 \mathrm{μs}\left({\color{gray}-0.291 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$10.8 \mathrm{ms} \pm 72.4 \mathrm{μs}\left({\color{gray}0.024 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$10.8 \mathrm{ms} \pm 69.9 \mathrm{μs}\left({\color{gray}-1.191 \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 $$10.9 \mathrm{ms} \pm 57.7 \mathrm{μs}\left({\color{gray}-1.204 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$11.0 \mathrm{ms} \pm 64.7 \mathrm{μs}\left({\color{gray}-0.752 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$11.1 \mathrm{ms} \pm 74.8 \mathrm{μs}\left({\color{gray}-1.071 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$11.0 \mathrm{ms} \pm 68.9 \mathrm{μs}\left({\color{gray}-2.802 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$11.0 \mathrm{ms} \pm 86.5 \mathrm{μs}\left({\color{gray}-0.579 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$11.0 \mathrm{ms} \pm 60.5 \mathrm{μs}\left({\color{lightgreen}-5.316 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$10.9 \mathrm{ms} \pm 61.7 \mathrm{μs}\left({\color{gray}-1.743 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$10.9 \mathrm{ms} \pm 61.1 \mathrm{μs}\left({\color{gray}-1.527 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$11.0 \mathrm{ms} \pm 81.4 \mathrm{μs}\left({\color{gray}0.186 \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.63 \mathrm{ms} \pm 45.6 \mathrm{μs}\left({\color{gray}-0.243 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$59.5 \mathrm{ms} \pm 477 \mathrm{μs}\left({\color{gray}0.778 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$112 \mathrm{ms} \pm 656 \mathrm{μs}\left({\color{gray}0.192 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$64.5 \mathrm{ms} \pm 528 \mathrm{μs}\left({\color{gray}0.575 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$75.9 \mathrm{ms} \pm 666 \mathrm{μs}\left({\color{gray}1.41 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$88.3 \mathrm{ms} \pm 992 \mathrm{μs}\left({\color{red}7.07 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$89.8 \mathrm{ms} \pm 667 \mathrm{μs}\left({\color{gray}-1.393 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$45.2 \mathrm{ms} \pm 280 \mathrm{μs}\left({\color{gray}1.01 \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 $$75.5 \mathrm{ms} \pm 489 \mathrm{μs}\left({\color{gray}1.08 \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 $$52.6 \mathrm{ms} \pm 408 \mathrm{μs}\left({\color{gray}0.547 \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 $$63.1 \mathrm{ms} \pm 594 \mathrm{μs}\left({\color{gray}3.55 \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 $$65.5 \mathrm{ms} \pm 529 \mathrm{μs}\left({\color{gray}3.57 \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 $$64.8 \mathrm{ms} \pm 621 \mathrm{μs}\left({\color{gray}2.32 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$117 \mathrm{ms} \pm 631 \mathrm{μs}\left({\color{gray}-4.818 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$131 \mathrm{ms} \pm 653 \mathrm{μs}\left({\color{gray}-1.768 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$19.2 \mathrm{ms} \pm 162 \mathrm{μs}\left({\color{lightgreen}-20.226 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$548 \mathrm{ms} \pm 1.25 \mathrm{ms}\left({\color{gray}1.20 \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