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 25, 2026 2:08pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview May 25, 2026 2:08pm
petrinaut Skipped Skipped May 25, 2026 2:08pm

@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 compile-time size bounds used by analysis passes; incorrect estimates could affect downstream optimizations or limits, but scope is localized to size_estimation with broad snapshot/unit test coverage.

Overview
Dynamic size estimation no longer treats every MIR aggregate the same. eval_rvalue_aggregate dispatches on AggregateKind: structs/tuples sum materialized operand information and force cardinality 1; lists join per-element materialized units and set cardinality to the literal element count; dicts join per-pair (key+value) materialized units with cardinality equal to pair count; closures combine fn ptr and env into a single scalar-sized footprint; opaque aggregates still sum raw footprints.

Supporting this, Footprint::materialize() folds (units, cardinality) into one information estimate (exact constant×constant, scaled affine×constant, linear under-approx for affine×affine), plus Footprint::one, Estimate::saturating_coeff_mul, InformationRange::saturating_mul_cardinality, and Eval::into_footprint. Tuple/struct snapshots that wrongly used field count as cardinality are corrected; new integration and unit tests lock in list/dict/tuple/struct-nested-list behavior.

Reviewed by Cursor Bugbot for commit 7cf9331. 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
@indietyp indietyp force-pushed the bm/be-512-hashql-switchint-allow-cross-backend-transitions branch from 59b8c62 to 55e6316 Compare May 13, 2026 09:57
@indietyp indietyp force-pushed the bm/be-513-hashql-size-estimation-aggregate-cardinality-is-wrong-for branch from b30e564 to 4176168 Compare May 13, 2026 09:57
@vercel vercel Bot temporarily deployed to Preview – petrinaut May 13, 2026 09:57 Inactive
@indietyp indietyp force-pushed the bm/be-512-hashql-switchint-allow-cross-backend-transitions branch from 55e6316 to 2a95250 Compare May 15, 2026 07:49
@indietyp indietyp force-pushed the bm/be-513-hashql-size-estimation-aggregate-cardinality-is-wrong-for branch from 4176168 to 480c017 Compare May 15, 2026 07:49
@vercel vercel Bot temporarily deployed to Preview – petrinaut May 15, 2026 07:49 Inactive
@indietyp indietyp force-pushed the bm/be-513-hashql-size-estimation-aggregate-cardinality-is-wrong-for branch from 480c017 to c113d41 Compare May 19, 2026 15:43
@vercel vercel Bot temporarily deployed to Preview – petrinaut May 19, 2026 15:43 Inactive
@indietyp indietyp force-pushed the bm/be-513-hashql-size-estimation-aggregate-cardinality-is-wrong-for branch from c113d41 to 839269e Compare May 20, 2026 14:46
@indietyp indietyp force-pushed the bm/be-512-hashql-switchint-allow-cross-backend-transitions branch from 5203abe to 026ce7b Compare May 20, 2026 14:46
@vercel vercel Bot temporarily deployed to Preview – petrinaut May 20, 2026 14:46 Inactive
@indietyp indietyp force-pushed the bm/be-512-hashql-switchint-allow-cross-backend-transitions branch from 026ce7b to b7cf577 Compare May 22, 2026 11:21
@indietyp indietyp force-pushed the bm/be-513-hashql-size-estimation-aggregate-cardinality-is-wrong-for branch from 839269e to b5ae5ee Compare May 22, 2026 11:21
@vercel vercel Bot temporarily deployed to Preview – petrinaut May 22, 2026 11:22 Inactive
@indietyp indietyp force-pushed the bm/be-512-hashql-switchint-allow-cross-backend-transitions branch from b7cf577 to db1e44d Compare May 25, 2026 13:27
@indietyp indietyp force-pushed the bm/be-513-hashql-size-estimation-aggregate-cardinality-is-wrong-for branch from b5ae5ee to 38f9579 Compare May 25, 2026 13:27
@vercel vercel Bot temporarily deployed to Preview – petrinaut May 25, 2026 13:27 Inactive
@indietyp indietyp force-pushed the bm/be-513-hashql-size-estimation-aggregate-cardinality-is-wrong-for branch from 38f9579 to d7036bb Compare May 25, 2026 13:58
@indietyp indietyp force-pushed the bm/be-512-hashql-switchint-allow-cross-backend-transitions branch from db1e44d to 0a4f75a Compare May 25, 2026 13:58
@vercel vercel Bot temporarily deployed to Preview – petrinaut May 25, 2026 13:58 Inactive
@indietyp indietyp force-pushed the bm/be-513-hashql-size-estimation-aggregate-cardinality-is-wrong-for branch from d7036bb to 7cf9331 Compare May 25, 2026 14:00
@vercel vercel Bot temporarily deployed to Preview – petrinaut May 25, 2026 14:01 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 129 \mathrm{μs}\left({\color{gray}0.140 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.45 \mathrm{ms} \pm 18.7 \mathrm{μs}\left({\color{gray}0.250 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1001 $$12.2 \mathrm{ms} \pm 66.8 \mathrm{μs}\left({\color{gray}-2.014 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$42.4 \mathrm{ms} \pm 246 \mathrm{μs}\left({\color{gray}-1.811 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$14.2 \mathrm{ms} \pm 83.4 \mathrm{μs}\left({\color{gray}-0.606 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1526 $$23.3 \mathrm{ms} \pm 157 \mathrm{μs}\left({\color{gray}-2.113 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$26.8 \mathrm{ms} \pm 218 \mathrm{μs}\left({\color{gray}-0.072 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.75 \mathrm{ms} \pm 18.9 \mathrm{μs}\left({\color{gray}0.261 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$13.1 \mathrm{ms} \pm 90.0 \mathrm{μs}\left({\color{gray}-2.505 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.74 \mathrm{ms} \pm 17.9 \mathrm{μs}\left({\color{gray}-2.388 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.00 \mathrm{ms} \pm 11.3 \mathrm{μs}\left({\color{gray}-3.322 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 51 $$3.37 \mathrm{ms} \pm 15.7 \mathrm{μs}\left({\color{gray}-2.624 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.09 \mathrm{ms} \pm 24.5 \mathrm{μs}\left({\color{gray}-4.252 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.58 \mathrm{ms} \pm 18.4 \mathrm{μs}\left({\color{gray}-2.150 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 107 $$4.13 \mathrm{ms} \pm 16.7 \mathrm{μs}\left({\color{gray}-2.559 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.39 \mathrm{ms} \pm 21.6 \mathrm{μs}\left({\color{gray}0.338 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.42 \mathrm{ms} \pm 12.5 \mathrm{μs}\left({\color{gray}-1.590 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.12 \mathrm{ms} \pm 17.3 \mathrm{μs}\left({\color{gray}0.481 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.72 \mathrm{ms} \pm 11.6 \mathrm{μs}\left({\color{gray}-3.158 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.70 \mathrm{ms} \pm 10.7 \mathrm{μs}\left({\color{gray}-2.349 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1 $$2.81 \mathrm{ms} \pm 11.9 \mathrm{μs}\left({\color{gray}-1.100 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$3.07 \mathrm{ms} \pm 11.7 \mathrm{μs}\left({\color{gray}-2.312 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.89 \mathrm{ms} \pm 13.1 \mathrm{μs}\left({\color{gray}-3.391 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$3.17 \mathrm{ms} \pm 10.7 \mathrm{μs}\left({\color{gray}-2.635 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.10 \mathrm{ms} \pm 15.3 \mathrm{μs}\left({\color{gray}0.209 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.81 \mathrm{ms} \pm 11.9 \mathrm{μs}\left({\color{gray}0.911 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 25 $$2.95 \mathrm{ms} \pm 15.7 \mathrm{μs}\left({\color{gray}-0.534 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.52 \mathrm{ms} \pm 19.7 \mathrm{μs}\left({\color{gray}-0.375 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.10 \mathrm{ms} \pm 13.8 \mathrm{μs}\left({\color{gray}0.658 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 26 $$3.30 \mathrm{ms} \pm 16.0 \mathrm{μs}\left({\color{gray}-0.153 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.46 \mathrm{ms} \pm 19.2 \mathrm{μs}\left({\color{gray}0.933 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.08 \mathrm{ms} \pm 12.2 \mathrm{μs}\left({\color{gray}-1.025 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.34 \mathrm{ms} \pm 19.5 \mathrm{μs}\left({\color{gray}-0.961 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$44.9 \mathrm{ms} \pm 159 \mathrm{μs}\left({\color{gray}-0.943 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$82.1 \mathrm{ms} \pm 349 \mathrm{μs}\left({\color{gray}-1.345 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$49.7 \mathrm{ms} \pm 206 \mathrm{μs}\left({\color{gray}-4.467 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$51.7 \mathrm{ms} \pm 402 \mathrm{μs}\left({\color{gray}-1.778 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$61.0 \mathrm{ms} \pm 320 \mathrm{μs}\left({\color{gray}-3.859 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$46.1 \mathrm{ms} \pm 165 \mathrm{μs}\left({\color{gray}-2.942 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$418 \mathrm{ms} \pm 922 \mathrm{μs}\left({\color{gray}2.89 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$99.1 \mathrm{ms} \pm 444 \mathrm{μs}\left({\color{gray}-4.292 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$82.1 \mathrm{ms} \pm 279 \mathrm{μs}\left({\color{gray}-4.075 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$283 \mathrm{ms} \pm 677 \mathrm{μs}\left({\color{gray}-2.868 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$19.4 \mathrm{ms} \pm 77.4 \mathrm{μs}\left({\color{lightgreen}-6.205 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$20.0 \mathrm{ms} \pm 79.4 \mathrm{μs}\left({\color{gray}-4.623 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$20.1 \mathrm{ms} \pm 93.7 \mathrm{μs}\left({\color{lightgreen}-5.245 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$19.8 \mathrm{ms} \pm 105 \mathrm{μs}\left({\color{gray}-4.935 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$24.7 \mathrm{ms} \pm 110 \mathrm{μs}\left({\color{gray}-2.978 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$19.2 \mathrm{ms} \pm 68.4 \mathrm{μs}\left({\color{lightgreen}-6.265 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$19.2 \mathrm{ms} \pm 83.0 \mathrm{μs}\left({\color{lightgreen}-5.926 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$19.3 \mathrm{ms} \pm 85.4 \mathrm{μs}\left({\color{gray}-4.160 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$19.8 \mathrm{ms} \pm 124 \mathrm{μs}\left({\color{lightgreen}-6.563 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$25.2 \mathrm{ms} \pm 169 \mathrm{μs}\left({\color{lightgreen}-7.918 \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.0 \mathrm{ms} \pm 258 \mathrm{μs}\left({\color{gray}-1.856 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$32.0 \mathrm{ms} \pm 229 \mathrm{μs}\left({\color{lightgreen}-12.385 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$33.3 \mathrm{ms} \pm 262 \mathrm{μs}\left({\color{gray}-4.687 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$32.8 \mathrm{ms} \pm 275 \mathrm{μs}\left({\color{lightgreen}-10.776 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$33.5 \mathrm{ms} \pm 255 \mathrm{μs}\left({\color{gray}-1.767 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$33.5 \mathrm{ms} \pm 247 \mathrm{μs}\left({\color{gray}0.287 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$33.2 \mathrm{ms} \pm 303 \mathrm{μs}\left({\color{lightgreen}-10.137 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$33.9 \mathrm{ms} \pm 240 \mathrm{μs}\left({\color{gray}-0.465 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$34.3 \mathrm{ms} \pm 303 \mathrm{μs}\left({\color{gray}-0.896 \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 30.9 \mathrm{μs}\left({\color{gray}-0.701 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$89.3 \mathrm{ms} \pm 307 \mathrm{μs}\left({\color{gray}-0.651 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$143 \mathrm{ms} \pm 622 \mathrm{μs}\left({\color{gray}2.38 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$96.2 \mathrm{ms} \pm 400 \mathrm{μs}\left({\color{gray}-0.816 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$105 \mathrm{ms} \pm 397 \mathrm{μs}\left({\color{gray}0.309 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$113 \mathrm{ms} \pm 409 \mathrm{μs}\left({\color{gray}0.302 \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 1.18 \mathrm{ms}\left({\color{gray}4.09 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$100 \mathrm{ms} \pm 380 \mathrm{μs}\left({\color{gray}-1.262 \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 $$130 \mathrm{ms} \pm 430 \mathrm{μs}\left({\color{gray}1.88 \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 $$107 \mathrm{ms} \pm 326 \mathrm{μs}\left({\color{gray}-0.819 \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 $$115 \mathrm{ms} \pm 379 \mathrm{μs}\left({\color{gray}-0.601 \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 $$117 \mathrm{ms} \pm 385 \mathrm{μs}\left({\color{gray}0.459 \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 $$118 \mathrm{ms} \pm 464 \mathrm{μs}\left({\color{gray}1.11 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$146 \mathrm{ms} \pm 426 \mathrm{μs}\left({\color{red}6.26 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$157 \mathrm{ms} \pm 425 \mathrm{μs}\left({\color{red}6.08 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$74.5 \mathrm{ms} \pm 3.45 \mathrm{ms}\left({\color{lightgreen}-31.040 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$540 \mathrm{ms} \pm 760 \mathrm{μs}\left({\color{lightgreen}-10.835 \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