Skip to content

BE-513: HashQL: Rework dynamic aggregate size estimation#8697

Open
indietyp wants to merge 4 commits into
bm/be-512-hashql-switchint-allow-cross-backend-transitionsfrom
bm/be-513-hashql-size-estimation-aggregate-cardinality-is-wrong-for
Open

BE-513: HashQL: Rework dynamic aggregate size estimation#8697
indietyp wants to merge 4 commits into
bm/be-512-hashql-switchint-allow-cross-backend-transitionsfrom
bm/be-513-hashql-size-estimation-aggregate-cardinality-is-wrong-for

Conversation

@indietyp
Copy link
Copy Markdown
Member

@indietyp indietyp commented May 4, 2026

🌟 What is the purpose of this PR?

The size estimation analysis previously treated all aggregate kinds (structs, tuples, lists, dicts, closures) identically — summing operand footprints and accumulating cardinality as if every aggregate were a flat collection. This was incorrect: a struct or tuple is a single composite value with cardinality 1, while a list or dict is a true collection whose cardinality equals its element count.

This PR introduces type-aware aggregate footprint evaluation. Structs and tuples now correctly report cardinality 1 with units equal to the sum of their fields' materialized sizes. Lists report per-element units (joined across elements) with cardinality equal to the element count. Dicts compute per-pair units (key + value combined) with cardinality equal to the pair count. Closures combine their function pointer and environment footprints into a single scalar value.

To support this, a materialize() method is introduced on Footprint that collapses a footprint's (units, cardinality) pair into a single total information estimate. This is needed when a value with its own cardinality (e.g. a list) is embedded as a field of a composite type — the field's contribution to the parent's units must account for the full information content of the nested value, not just its per-element size.

🔍 What does this change?

  • Replaces the single generic RValue::Aggregate handler in eval_rvalue with a dedicated eval_rvalue_aggregate method that dispatches on AggregateKind.
  • Struct/Tuple: sums the materialize()d footprints of all operands and sets cardinality to 1.
  • List: joins per-element materialized units and sets cardinality to the literal element count.
  • Dict: joins per-pair materialized units (key + value combined via saturating_mul_add) and sets cardinality to the pair count.
  • Closure: combines function pointer and environment footprints into a single scalar (cardinality 1).
  • Opaque: retains the previous behaviour of summing raw footprints.
  • Adds Footprint::materialize() which multiplies units by cardinality to produce a total information estimate, with case-specific handling for constant×constant (exact), affine units×constant cardinality (scale coefficients by cardinality upper bound), and affine×affine (element-wise coefficient multiplication as a linear under-approximation).
  • Adds Footprint::one(units) constructor for footprints with cardinality exactly 1.
  • Adds Estimate::saturating_coeff_mul for element-wise coefficient multiplication between two estimates.
  • Adds InformationRange::saturating_mul_cardinality for range-level multiplication of information by cardinality, saturating to unbounded on overflow.
  • Adds Eval::into_footprint as a consuming counterpart to Eval::as_ref.
  • Fixes the snapshot for struct_aggregate_sums_operands and tuple_aggregate_sums_operands, which previously reported cardinality 2 for a two-field struct/tuple; both now correctly report cardinality 1.

🛡 What tests cover this?

  • New integration tests: list_aggregate_per_element_units, dict_aggregate_per_pair_units, tuple_many_fields_cardinality_one, and struct_materializes_list_parameter, each with corresponding snapshot files.
  • New unit tests in footprint.rs covering all four materialize() branches: scalar identity, constant×constant, affine units×constant cardinality, constant units×affine cardinality, and both-affine same-parameter.
  • New unit tests in range.rs covering saturating_mul_cardinality: exact multiplication, identity by 1, empty inputs, unbounded cardinality, and overflow to unbounded.

❓ How to test this?

  1. Run cargo test -p hashql-mir and confirm all tests pass.
  2. Review the new and updated snapshots under libs/@local/hashql/mir/tests/ui/pass/size-estimation/ to verify the reported units and cardinality values match the expected semantics for each aggregate kind.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

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

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

@vercel vercel Bot temporarily deployed to Preview – petrinaut May 4, 2026 14:23 Inactive
@cursor
Copy link
Copy Markdown

cursor Bot commented May 4, 2026

PR Summary

Medium Risk
Changes core size-estimation math and aggregate handling, which can alter optimization/planning decisions that depend on these estimates. Added coverage reduces risk, but edge cases around affine materialization and unbounded ranges could shift results.

Overview
Reworks dynamic aggregate footprint evaluation so RValue::Aggregate is dispatched by AggregateKind instead of treating all aggregates as flat collections.

Structs/tuples now sum materialized field sizes with cardinality fixed to 1, while lists/dicts compute per-element/per-pair units (via join over materialized operands) with cardinality set to the literal element/pair count; closures combine fn ptr + env into a single scalar footprint, and opaque aggregates keep the prior “sum raw operands” behavior.

Adds supporting math/utilities: Footprint::materialize() (collapse units × cardinality), Footprint::one(), Estimate::saturating_coeff_mul(), InformationRange::saturating_mul_cardinality(), and Eval::into_footprint(). Updates/extends tests and UI snapshots to reflect corrected cardinalities and new aggregate behaviors.

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

@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 May 4, 2026
Copy link
Copy Markdown
Member Author

indietyp commented May 4, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

@indietyp indietyp force-pushed the bm/be-513-hashql-size-estimation-aggregate-cardinality-is-wrong-for branch from d52594c to ae2d3af Compare May 4, 2026 14:24
@indietyp indietyp force-pushed the bm/be-512-hashql-switchint-allow-cross-backend-transitions branch from fb7f8ba to 5eeec53 Compare May 4, 2026 14:24
@vercel vercel Bot temporarily deployed to Preview – petrinaut May 4, 2026 14:24 Inactive
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. 1 suggestion posted.

Fix All in Augment

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

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 4, 2026

Merging this PR will degrade performance by 11.34%

⚠️ 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

❌ 4 regressed benchmarks
✅ 20 untouched benchmarks
⏩ 56 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
entity_projections 64.9 µs 73.2 µs -11.34%
fibonacci_recursive[16] 1.8 ms 2.1 ms -10.86%
diamond 16.2 µs 18 µs -10.03%
fibonacci_recursive[24] 85.9 ms 96.4 ms -10.9%

Comparing bm/be-513-hashql-size-estimation-aggregate-cardinality-is-wrong-for (393f316) with main (a18ae88)2

Open in CodSpeed

Footnotes

  1. 56 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on bm/be-512-hashql-switchint-allow-cross-backend-transitions (43c449a) during the generation of this report, so main (a18ae88) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

❌ Patch coverage is 91.07143% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.64%. Comparing base (43c449a) to head (393f316).

Files with missing lines Patch % Lines
...l/mir/src/pass/analysis/size_estimation/dynamic.rs 73.49% 22 Missing ⚠️
...mir/src/pass/analysis/size_estimation/footprint.rs 92.15% 4 Missing and 4 partials ⚠️
Additional details and impacted files
@@                                      Coverage Diff                                       @@
##           bm/be-512-hashql-switchint-allow-cross-backend-transitions    #8697      +/-   ##
==============================================================================================
+ Coverage                                                       68.56%   68.64%   +0.08%     
==============================================================================================
  Files                                                            1061     1061              
  Lines                                                          106420   106748     +328     
  Branches                                                         4986     4993       +7     
==============================================================================================
+ Hits                                                            72963    73277     +314     
- Misses                                                          32706    32717      +11     
- Partials                                                          751      754       +3     
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-compiletest 28.26% <ø> (ø)
rust.hashql-eval 79.70% <ø> (ø)
rust.hashql-mir 91.88% <91.07%> (+0.04%) ⬆️

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 May 4, 2026 14:42 Inactive
@indietyp indietyp force-pushed the bm/be-512-hashql-switchint-allow-cross-backend-transitions branch from 5eeec53 to 91d9bc3 Compare May 8, 2026 08:33
@indietyp indietyp force-pushed the bm/be-513-hashql-size-estimation-aggregate-cardinality-is-wrong-for branch from 598d416 to a64c0f8 Compare May 8, 2026 08:33
@vercel vercel Bot temporarily deployed to Preview – petrinaut May 8, 2026 08:34 Inactive
@indietyp indietyp force-pushed the bm/be-512-hashql-switchint-allow-cross-backend-transitions branch from 91d9bc3 to f2fc415 Compare May 11, 2026 10:58
@indietyp indietyp force-pushed the bm/be-513-hashql-size-estimation-aggregate-cardinality-is-wrong-for branch from a64c0f8 to 80db587 Compare May 11, 2026 10:58
@vercel vercel Bot temporarily deployed to Preview – petrinaut May 11, 2026 10:58 Inactive
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 80db587. Configure here.

@indietyp indietyp force-pushed the bm/be-512-hashql-switchint-allow-cross-backend-transitions branch from f2fc415 to 43c449a Compare May 12, 2026 13:58
@indietyp indietyp force-pushed the bm/be-513-hashql-size-estimation-aggregate-cardinality-is-wrong-for branch from 80db587 to 393f316 Compare May 12, 2026 13:58
@vercel vercel Bot temporarily deployed to Preview – petrinaut May 12, 2026 13:58 Inactive
@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 $$25.9 \mathrm{ms} \pm 156 \mathrm{μs}\left({\color{gray}0.593 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.41 \mathrm{ms} \pm 12.7 \mathrm{μs}\left({\color{gray}-0.341 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1001 $$12.3 \mathrm{ms} \pm 69.3 \mathrm{μs}\left({\color{gray}-1.566 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$42.7 \mathrm{ms} \pm 279 \mathrm{μs}\left({\color{gray}-1.140 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$14.7 \mathrm{ms} \pm 109 \mathrm{μs}\left({\color{gray}-1.714 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1526 $$24.0 \mathrm{ms} \pm 135 \mathrm{μs}\left({\color{gray}-1.385 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$26.9 \mathrm{ms} \pm 143 \mathrm{μs}\left({\color{gray}0.886 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.77 \mathrm{ms} \pm 18.7 \mathrm{μs}\left({\color{gray}1.95 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$13.5 \mathrm{ms} \pm 88.7 \mathrm{μs}\left({\color{gray}0.517 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.75 \mathrm{ms} \pm 26.4 \mathrm{μs}\left({\color{gray}0.953 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.99 \mathrm{ms} \pm 13.1 \mathrm{μs}\left({\color{gray}0.503 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 51 $$3.35 \mathrm{ms} \pm 15.9 \mathrm{μs}\left({\color{gray}0.275 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.14 \mathrm{ms} \pm 35.5 \mathrm{μs}\left({\color{gray}2.10 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.60 \mathrm{ms} \pm 19.1 \mathrm{μs}\left({\color{gray}0.839 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 107 $$4.11 \mathrm{ms} \pm 22.7 \mathrm{μs}\left({\color{gray}0.891 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.38 \mathrm{ms} \pm 36.8 \mathrm{μs}\left({\color{gray}2.47 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.46 \mathrm{ms} \pm 15.1 \mathrm{μs}\left({\color{gray}0.903 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.06 \mathrm{ms} \pm 25.0 \mathrm{μs}\left({\color{gray}0.569 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.68 \mathrm{ms} \pm 11.4 \mathrm{μs}\left({\color{gray}-0.131 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.48 \mathrm{ms} \pm 10.4 \mathrm{μs}\left({\color{gray}-1.775 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1 $$2.62 \mathrm{ms} \pm 11.8 \mathrm{μs}\left({\color{gray}-1.630 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.96 \mathrm{ms} \pm 15.2 \mathrm{μs}\left({\color{gray}-0.118 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.75 \mathrm{ms} \pm 12.2 \mathrm{μs}\left({\color{gray}-0.114 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.89 \mathrm{ms} \pm 10.1 \mathrm{μs}\left({\color{gray}-2.217 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.00 \mathrm{ms} \pm 15.8 \mathrm{μs}\left({\color{gray}-0.163 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.72 \mathrm{ms} \pm 16.0 \mathrm{μs}\left({\color{gray}-1.232 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 25 $$2.98 \mathrm{ms} \pm 17.9 \mathrm{μs}\left({\color{gray}0.073 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.35 \mathrm{ms} \pm 18.5 \mathrm{μs}\left({\color{gray}-1.000 \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.103 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 26 $$3.28 \mathrm{ms} \pm 16.5 \mathrm{μs}\left({\color{gray}-0.340 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.23 \mathrm{ms} \pm 12.4 \mathrm{μs}\left({\color{gray}-1.670 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.95 \mathrm{ms} \pm 15.2 \mathrm{μs}\left({\color{gray}-0.265 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.32 \mathrm{ms} \pm 22.2 \mathrm{μs}\left({\color{gray}0.384 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$54.5 \mathrm{ms} \pm 286 \mathrm{μs}\left({\color{gray}-2.047 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$46.1 \mathrm{ms} \pm 177 \mathrm{μs}\left({\color{gray}-1.258 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$50.3 \mathrm{ms} \pm 196 \mathrm{μs}\left({\color{gray}-1.758 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$44.5 \mathrm{ms} \pm 243 \mathrm{μs}\left({\color{gray}-0.455 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$61.7 \mathrm{ms} \pm 345 \mathrm{μs}\left({\color{gray}-1.840 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$61.5 \mathrm{ms} \pm 289 \mathrm{μs}\left({\color{gray}-0.750 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$56.8 \mathrm{ms} \pm 289 \mathrm{μs}\left({\color{gray}0.091 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$103 \mathrm{ms} \pm 447 \mathrm{μs}\left({\color{gray}-0.715 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$46.7 \mathrm{ms} \pm 224 \mathrm{μs}\left({\color{gray}-0.036 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$323 \mathrm{ms} \pm 1.16 \mathrm{ms}\left({\color{red}18.7 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$19.9 \mathrm{ms} \pm 114 \mathrm{μs}\left({\color{gray}2.74 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$20.5 \mathrm{ms} \pm 98.1 \mathrm{μs}\left({\color{gray}1.56 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$20.9 \mathrm{ms} \pm 117 \mathrm{μs}\left({\color{gray}2.39 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$19.6 \mathrm{ms} \pm 107 \mathrm{μs}\left({\color{gray}-0.028 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$25.5 \mathrm{ms} \pm 130 \mathrm{μs}\left({\color{gray}-0.236 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$19.5 \mathrm{ms} \pm 86.6 \mathrm{μs}\left({\color{gray}-1.069 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$19.7 \mathrm{ms} \pm 89.9 \mathrm{μs}\left({\color{gray}-0.020 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$19.9 \mathrm{ms} \pm 100 \mathrm{μs}\left({\color{gray}0.619 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$20.4 \mathrm{ms} \pm 109 \mathrm{μs}\left({\color{gray}0.479 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$27.2 \mathrm{ms} \pm 194 \mathrm{μs}\left({\color{gray}-1.151 \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.7 \mathrm{ms} \pm 266 \mathrm{μs}\left({\color{gray}-2.176 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$34.5 \mathrm{ms} \pm 292 \mathrm{μs}\left({\color{gray}1.67 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$34.5 \mathrm{ms} \pm 296 \mathrm{μs}\left({\color{gray}0.673 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$35.3 \mathrm{ms} \pm 239 \mathrm{μs}\left({\color{gray}0.036 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$34.3 \mathrm{ms} \pm 242 \mathrm{μs}\left({\color{gray}-2.167 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$34.6 \mathrm{ms} \pm 200 \mathrm{μs}\left({\color{gray}-0.888 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$34.8 \mathrm{ms} \pm 290 \mathrm{μs}\left({\color{gray}-1.280 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$34.4 \mathrm{ms} \pm 245 \mathrm{μs}\left({\color{gray}0.344 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$34.4 \mathrm{ms} \pm 271 \mathrm{μs}\left({\color{gray}-0.035 \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.52 \mathrm{ms} \pm 46.5 \mathrm{μs}\left({\color{gray}0.048 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$92.4 \mathrm{ms} \pm 486 \mathrm{μs}\left({\color{gray}1.04 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$146 \mathrm{ms} \pm 795 \mathrm{μs}\left({\color{gray}0.406 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$99.1 \mathrm{ms} \pm 637 \mathrm{μs}\left({\color{gray}0.235 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$110 \mathrm{ms} \pm 589 \mathrm{μs}\left({\color{gray}-0.278 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$116 \mathrm{ms} \pm 845 \mathrm{μs}\left({\color{gray}-0.577 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$124 \mathrm{ms} \pm 519 \mathrm{μs}\left({\color{gray}-0.237 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$103 \mathrm{ms} \pm 504 \mathrm{μs}\left({\color{gray}-0.135 \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 515 \mathrm{μs}\left({\color{gray}0.566 \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 $$111 \mathrm{ms} \pm 534 \mathrm{μs}\left({\color{gray}1.19 \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 $$121 \mathrm{ms} \pm 528 \mathrm{μs}\left({\color{gray}1.89 \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 $$123 \mathrm{ms} \pm 494 \mathrm{μs}\left({\color{gray}2.15 \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 $$123 \mathrm{ms} \pm 1.08 \mathrm{ms}\left({\color{gray}2.17 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$190 \mathrm{ms} \pm 1.53 \mathrm{ms}\left({\color{gray}-0.804 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$155 \mathrm{ms} \pm 434 \mathrm{μs}\left({\color{lightgreen}-23.971 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$39.9 \mathrm{ms} \pm 169 \mathrm{μs}\left({\color{gray}-2.309 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$575 \mathrm{ms} \pm 923 \mathrm{μs}\left({\color{gray}1.57 \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