Skip to content

SRE-989: Carry crate source hashes without implying a build - #9543

Open
TimDiekmann wants to merge 5 commits into
mainfrom
t/sre-989-carry-crate-source-hashes-without-a-build
Open

SRE-989: Carry crate source hashes without implying a build#9543
TimDiekmann wants to merge 5 commits into
mainfrom
t/sre-989-carry-crate-source-hashes-without-a-build

Conversation

@TimDiekmann

@TimDiekmann TimDiekmann commented Sep 5, 2026

Copy link
Copy Markdown
Member

🌟 What is the purpose of this PR?

The crates' build:types, build:wasm and build:openapi tasks depend on ^build so that a change in an upstream crate reaches their hash and affectedTasks. For a crate's mirror package build is a no-op today, but under futureFlags.experimentalCargoWorkspaces it becomes cargo build — the chain would compile every upstream crate before generating a single type.

This replaces the chain with a dependency that carries the source hashes and runs nothing.

🔗 Related links

  • SRE-989
  • SRE-984 — the Cargo-workspace move this clears the way for

🔍 What does this change?

  • manifest is a root task nothing implements, chained over ^manifest. Depending on it folds the inputs of every transitive dependency into a task's hash and lets affectedTasks walk the chain, without executing anything.
  • build:types, build:wasm and build:openapi depend on ^manifest instead of ^build, which resolves the TODO(SRE-989) markers SRE-988 left.
  • One edge disappears from the checked-in task dependencies: hash-graph-api#build:openapi no longer waits for @local/status#build. The crate hash-status is mirrored with the TypeScript @local/status as its only dependency, so ^build reached a tsc --build two tasks without a command away.

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:

  • affected the execution graph, and the turbo.json's have been updated to reflect this

⚠️ Known issues

The manifest task is an empty carrier: it appears in turbo run --dry output and in turbo query, and has no command. A reader meeting @rust/error-stack#manifest in a dependency list has to know it exists only for its hash. The root turbo.json says so where it is declared, and the checked-in task dependencies do not list it at all, since they record what executes.

🐾 Next steps

The root defaults still carry the recursive codegen → ^build and test:unit → ^build chains for the JavaScript packages. Dissolving those is the next PR, stacked on this one, and the checked-in task dependencies will show its effect edge by edge.

@rust/hash-status depending on the TypeScript @local/status is a leftover worth removing, in a change of its own.

🛡 What tests cover this?

The checked-in task dependencies are regenerated in CI and diffed; the one changed document is part of this PR. Verified by measurement: a probe in error-stack moves @rust/hash-codec#build:types from 5b22f4cb to 8145afd3 and back, and affectedTasks for that probe still selects the sibling @blockprotocol/type-system package with codegen and lint:tsc.

❓ How to test this?

  1. Check out the branch
  2. Change a file in libs/error-stack/src
  3. Run turbo run build:types --filter @rust/hash-codec --dry=json and confirm the task's hash differs from a run without the change
  4. Run turbo query 'query { affectedTasks(base: "HEAD") { items { fullName } } }' and confirm @blockprotocol/type-system#codegen is listed

`build:types`, `build:wasm` and `build:openapi` depended on `^build` so
that a change in an upstream crate reaches their hash and `affectedTasks`.
For a crate's mirror package `build` is a no-op today, but under
`futureFlags.experimentalCargoWorkspaces` it becomes `cargo build`, and
the chain would compile every upstream crate before generating types.

`manifest` is a task nothing implements. Depending on `^manifest` folds
the inputs of every transitive dependency into the hash and keeps
`affectedTasks` walking the chain, while running nothing: a change in
`error-stack`, two levels up, moves `@rust/hash-codec#build:types` from
5b22f4cb to 8145afd3 and still selects the sibling
`@blockprotocol/type-system` package.

The one edge that disappears from the documents is
`hash-graph-api#build:openapi` waiting for `@local/status#build`. The
mirror of the crate `hash-status` lists the TypeScript `@local/status` as
its only dependency, so `^build` reached a `tsc --build` two tasks without
a command away.
@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
hash Ready Ready Preview Sep 6, 2026 1:43pm UTC
hashdotdesign-tokens Ready Ready Preview Sep 6, 2026 1:43pm UTC
petrinaut Ready Ready Preview Sep 6, 2026 1:43pm UTC
petrinaut-docs Ready Ready Preview Sep 6, 2026 1:43pm UTC

Request Review

@github-actions github-actions Bot added area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team labels Sep 5, 2026
@TimDiekmann TimDiekmann self-assigned this Sep 5, 2026
@TimDiekmann TimDiekmann changed the title t/sre 989 carry crate source hashes without a build SRE-989: Carry crate source hashes without implying a build Sep 5, 2026
@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.89%. Comparing base (eea4e1f) to head (c0decf5).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9543      +/-   ##
==========================================
- Coverage   60.89%   60.89%   -0.01%     
==========================================
  Files        1461     1461              
  Lines      146725   146725              
  Branches     6744     6744              
==========================================
- Hits        89343    89342       -1     
- Misses      56264    56265       +1     
  Partials     1118     1118              
Flag Coverage Δ
apps.hash-ai-worker-ts 1.99% <ø> (ø)
apps.hash-api 15.41% <ø> (ø)
apps.hash-graph 13.32% <ø> (ø)
blockprotocol.type-system 38.15% <ø> (ø)
local.claude-hooks 0.00% <ø> (ø)
local.harpc-client 51.49% <ø> (ø)
local.hash-backend-utils 3.27% <ø> (ø)
local.hash-graph-sdk 10.02% <ø> (ø)
local.hash-isomorphic-utils 12.22% <ø> (ø)
rust.antsi 2.36% <ø> (ø)
rust.error-stack 90.81% <ø> (ø)
rust.harpc-codec 84.70% <ø> (ø)
rust.harpc-net 96.19% <ø> (-0.02%) ⬇️
rust.harpc-tower 67.03% <ø> (ø)
rust.harpc-types 0.00% <ø> (ø)
rust.harpc-wire-protocol 92.23% <ø> (ø)
rust.hash-codec 72.76% <ø> (ø)
rust.hash-config 74.74% <ø> (ø)
rust.hash-graph-api 19.71% <ø> (ø)
rust.hash-graph-authentication 96.02% <ø> (ø)
rust.hash-graph-authorization 63.14% <ø> (ø)
rust.hash-graph-embeddings 91.88% <ø> (ø)
rust.hash-graph-postgres-store 32.15% <ø> (ø)
rust.hash-graph-store 48.41% <ø> (ø)
rust.hash-graph-temporal-versioning 50.18% <ø> (ø)
rust.hash-graph-types 0.00% <ø> (ø)
rust.hash-graph-validation 84.71% <ø> (ø)
rust.hashql-ast 89.63% <ø> (ø)
rust.hashql-compiletest 28.39% <ø> (ø)
rust.hashql-core 78.95% <ø> (ø)
rust.hashql-diagnostics 72.51% <ø> (ø)
rust.hashql-eval 79.82% <ø> (ø)
rust.hashql-hir 89.09% <ø> (ø)
rust.hashql-mir 87.92% <ø> (ø)
rust.hashql-syntax-jexpr 94.04% <ø> (ø)

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.

@codspeed-hq

codspeed-hq Bot commented Sep 5, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 6 benchmarks measured no execution time

Nothing ran under measurement, usually because the compiler removed the code under test. These results are not comparable, so they count as unchanged.

Preventing compiler optimizations

✅ 98 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
⚠️ as_constant < 1 ns < 1 ns N/A
⚠️ constant_equal < 1 ns < 1 ns N/A
⚠️ constant_not_equal < 1 ns < 1 ns N/A
⚠️ access < 1 ns < 1 ns N/A
⚠️ runtime_equal < 1 ns < 1 ns N/A
⚠️ runtime_not_equal < 1 ns < 1 ns N/A

Comparing t/sre-989-carry-crate-source-hashes-without-a-build (c0decf5) with main (4854d5f)1

Open in CodSpeed

Footnotes

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

The client's codegen and the hickory binding's build depended on the
crates' `build`, a task neither crate has, and carried TODO markers for
it. They now depend on the crates' `manifest`, so a change in the crate
still selects the package without asking it for a build.
Three files import the `Status` type from `@local/status`, which the
package never declared. Its build had still run first, reached through
`@local/hash-graph-client#codegen → @rust/hash-graph-api#build →
@rust/hash-status#build → ^build`, a chain of tasks that do not exist.
The manifest edge no longer walks it, and `tsc` found no declarations.
@vercel
vercel Bot temporarily deployed to Preview – petrinaut September 5, 2026 11:53 Inactive
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs September 5, 2026 11:53 Inactive
@github-actions github-actions Bot added area/deps Relates to third-party dependencies (area) area/apps > hash* Affects HASH (a `hash-*` app) labels Sep 5, 2026
`import/no-extraneous-dependencies` skips `import type` unless
`includeTypes` is set, so a package could import types from a package it
never declared and resolve them through hoisting or a dependency's
build. The rule now checks type imports everywhere, with the
`devDependencies` globs `eslint-config-airbnb-base` had supplied.

Three packages had such imports and now declare them: the API and the
AI worker import the internal API client's types, both workers the
Temporal client's, and the AI worker also imports from
`@blockprotocol/core`. The API's and the AI worker's tasks now run the
internal API client's build before them instead of relying on the
backend utils to pull it in.
@github-actions github-actions Bot added the area/apps > hash-api Affects the HASH API (app) label Sep 5, 2026
`includeTypes` on `import/no-extraneous-dependencies` also applied
airbnb's split between `dependencies` and `devDependencies` to type
imports, so a type used in nothing but a cast had to move into
`dependencies`. The plugin is registered a second time as
`import-declared`, and that instance of the rule runs with
`devDependencies: true` and `includeTypes: true`: it asks whether an
import is declared at all. The original rule keeps its options for value
imports, and the package configurations that override it leave the
second instance in place.

Two imports of a package by its own name become relative imports, and
the AI worker declares the `vite` its vitest config had imported behind
a disable directive.
@cursor

cursor Bot commented Sep 6, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Mostly Turborepo graph and dependency-manifest changes; runtime behavior is unchanged aside from stricter ESLint dependency checks and import path tweaks.

Overview
Introduces a root manifest Turborepo task that no package implements: depending on ^manifest folds transitive crate/package inputs into task hashes and affectedTasks without running upstream build (important before Cargo workspace builds make crate build real compiles).

build:types, build:wasm, and build:openapi (plus @local/hash-graph-client#codegen and effect-dns hickory build) now depend on ^manifest or @rust/...#manifest instead of ^build, clearing the SRE-989 TODOs. Checked-in task deps drop @local/status#build from @rust/hash-graph-api#build:openapi.

Smaller follow-ons in the same diff: declare vite / @temporalio/client / @local/internal-api-client where imports need them; enforce import-declared/no-extraneous-dependencies in shared ESLint config; fix a few type imports in @blockprotocol/graph and type-system; @local/hash-isomorphic-utils adds @local/status for codegen/task graphs.

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

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.

🟢 Approval recommended

The review found no unresolved or approval-blocking issues.

Pull request overview

Introduces no-op manifest tasks to propagate Rust source hashes without compiling upstream crates.

Changes:

  • Replaces upstream build dependencies with hash-only manifest chains.
  • Adds missing dependency declarations and corrects internal imports.
  • Refreshes generated task graphs and lockfile metadata.
File summaries
File Description
yarn.lock Updates dependency lock metadata.
turbo.json Defines the recursive manifest task.
libs/@local/hash-isomorphic-utils/package.json Declares the status dependency.
libs/@local/hash-isomorphic-utils/docs/task-dependencies.json Refreshes generated dependency metadata.
libs/@local/graph/store/rust/turbo.json Uses manifest hashes for type generation.
libs/@local/graph/client/typescript/turbo.json Replaces a build edge with a manifest edge.
libs/@local/graph/client/typescript/docs/task-dependencies.json Removes the obsolete executable edge.
libs/@local/graph/authorization/rust/turbo.json Uses manifest hashes for type generation.
libs/@local/graph/api/turbo.json Uses manifest hashes for OpenAPI generation.
libs/@local/graph/api/docs/task-dependencies.json Updates the generated task graph.
libs/@local/eslint/src/deprecated/base.ts Checks type-only imports for declared dependencies.
libs/@local/effect-dns/hickory/typescript/turbo.json Replaces a Rust build edge with a manifest edge.
libs/@local/codec/rust/turbo.json Uses manifest hashes for type generation.
libs/@blockprotocol/type-system/typescript/src/native/time.ts Replaces a package self-import with a relative import.
libs/@blockprotocol/type-system/rust/turbo.json Uses manifest hashes for WASM and type generation.
libs/@blockprotocol/graph/src/internal/mutate-subgraph/edge.ts Replaces a package self-import with a relative import.
apps/hash-integration-worker/package.json Declares the Temporal client dependency.
apps/hash-api/package.json Declares the internal API client dependency.
apps/hash-api/docs/task-dependencies.json Refreshes generated dependency metadata.
apps/hash-ai-worker-ts/vitest.config.ts Removes an obsolete lint suppression.
apps/hash-ai-worker-ts/package.json Declares previously implicit dependencies.
apps/hash-ai-worker-ts/docs/task-dependencies.json Refreshes generated dependency metadata.
Review details
  • Files reviewed: 21/22 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 6, 2026

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 $$30.0 \mathrm{ms} \pm 328 \mathrm{μs}\left({\color{gray}4.35 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.96 \mathrm{ms} \pm 41.5 \mathrm{μs}\left({\color{red}6.50 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1002 $$14.1 \mathrm{ms} \pm 144 \mathrm{μs}\left({\color{gray}-2.801 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$45.8 \mathrm{ms} \pm 390 \mathrm{μs}\left({\color{gray}-0.600 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$15.9 \mathrm{ms} \pm 175 \mathrm{μs}\left({\color{gray}2.94 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1527 $$26.9 \mathrm{ms} \pm 268 \mathrm{μs}\left({\color{gray}0.271 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$29.8 \mathrm{ms} \pm 230 \mathrm{μs}\left({\color{gray}0.251 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$4.20 \mathrm{ms} \pm 36.7 \mathrm{μs}\left({\color{red}7.60 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$15.4 \mathrm{ms} \pm 119 \mathrm{μs}\left({\color{gray}1.63 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.96 \mathrm{ms} \pm 33.7 \mathrm{μs}\left({\color{lightgreen}-5.550 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.27 \mathrm{ms} \pm 21.9 \mathrm{μs}\left({\color{gray}-3.296 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 52 $$3.57 \mathrm{ms} \pm 25.4 \mathrm{μs}\left({\color{gray}-4.881 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.52 \mathrm{ms} \pm 42.6 \mathrm{μs}\left({\color{lightgreen}-7.939 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.75 \mathrm{ms} \pm 24.3 \mathrm{μs}\left({\color{gray}-2.624 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 108 $$4.35 \mathrm{ms} \pm 36.6 \mathrm{μs}\left({\color{gray}-4.550 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.75 \mathrm{ms} \pm 48.7 \mathrm{μs}\left({\color{gray}-1.357 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.66 \mathrm{ms} \pm 27.2 \mathrm{μs}\left({\color{gray}-0.430 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.48 \mathrm{ms} \pm 29.7 \mathrm{μs}\left({\color{gray}-0.602 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.87 \mathrm{ms} \pm 18.4 \mathrm{μs}\left({\color{lightgreen}-7.412 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.78 \mathrm{ms} \pm 20.8 \mathrm{μs}\left({\color{lightgreen}-6.963 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 2 $$2.96 \mathrm{ms} \pm 18.8 \mathrm{μs}\left({\color{lightgreen}-5.281 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$3.28 \mathrm{ms} \pm 23.5 \mathrm{μs}\left({\color{lightgreen}-5.010 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.05 \mathrm{ms} \pm 25.2 \mathrm{μs}\left({\color{gray}-3.969 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$3.31 \mathrm{ms} \pm 26.1 \mathrm{μs}\left({\color{lightgreen}-5.837 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.21 \mathrm{ms} \pm 25.0 \mathrm{μs}\left({\color{lightgreen}-11.927 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.94 \mathrm{ms} \pm 21.6 \mathrm{μs}\left({\color{lightgreen}-10.396 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 26 $$3.12 \mathrm{ms} \pm 20.9 \mathrm{μs}\left({\color{lightgreen}-11.913 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.74 \mathrm{ms} \pm 24.2 \mathrm{μs}\left({\color{lightgreen}-7.411 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.27 \mathrm{ms} \pm 23.9 \mathrm{μs}\left({\color{gray}-0.616 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 27 $$3.63 \mathrm{ms} \pm 30.5 \mathrm{μs}\left({\color{gray}1.12 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.62 \mathrm{ms} \pm 33.8 \mathrm{μs}\left({\color{lightgreen}-5.573 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.17 \mathrm{ms} \pm 22.9 \mathrm{μs}\left({\color{gray}-4.741 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.52 \mathrm{ms} \pm 29.4 \mathrm{μs}\left({\color{gray}-3.350 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$34.5 \mathrm{ms} \pm 279 \mathrm{μs}\left({\color{gray}0.955 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$74.9 \mathrm{ms} \pm 577 \mathrm{μs}\left({\color{gray}0.714 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$38.3 \mathrm{ms} \pm 286 \mathrm{μs}\left({\color{gray}-1.964 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$41.2 \mathrm{ms} \pm 275 \mathrm{μs}\left({\color{gray}-0.946 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$47.1 \mathrm{ms} \pm 325 \mathrm{μs}\left({\color{gray}3.55 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$35.2 \mathrm{ms} \pm 313 \mathrm{μs}\left({\color{gray}-2.569 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$431 \mathrm{ms} \pm 1.46 \mathrm{ms}\left({\color{gray}2.75 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$96.5 \mathrm{ms} \pm 618 \mathrm{μs}\left({\color{gray}-0.683 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$81.4 \mathrm{ms} \pm 594 \mathrm{μs}\left({\color{gray}-1.949 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$291 \mathrm{ms} \pm 1.50 \mathrm{ms}\left({\color{gray}-0.339 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$10.6 \mathrm{ms} \pm 68.4 \mathrm{μs}\left({\color{lightgreen}-17.680 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$11.6 \mathrm{ms} \pm 75.0 \mathrm{μs}\left({\color{lightgreen}-7.694 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$11.6 \mathrm{ms} \pm 82.0 \mathrm{μs}\left({\color{lightgreen}-7.964 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$11.1 \mathrm{ms} \pm 93.7 \mathrm{μs}\left({\color{gray}-3.021 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$11.3 \mathrm{ms} \pm 95.0 \mathrm{μs}\left({\color{lightgreen}-7.541 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$11.1 \mathrm{ms} \pm 86.2 \mathrm{μs}\left({\color{lightgreen}-7.611 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$11.0 \mathrm{ms} \pm 78.9 \mathrm{μs}\left({\color{lightgreen}-7.027 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$12.5 \mathrm{ms} \pm 143 \mathrm{μs}\left({\color{red}7.95 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$11.9 \mathrm{ms} \pm 84.0 \mathrm{μs}\left({\color{gray}0.345 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$11.5 \mathrm{ms} \pm 149 \mathrm{μs}\left({\color{gray}-4.907 \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 $$11.6 \mathrm{ms} \pm 94.5 \mathrm{μs}\left({\color{lightgreen}-14.261 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$11.8 \mathrm{ms} \pm 94.5 \mathrm{μs}\left({\color{gray}-4.502 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$12.0 \mathrm{ms} \pm 93.7 \mathrm{μs}\left({\color{lightgreen}-5.722 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$13.0 \mathrm{ms} \pm 123 \mathrm{μs}\left({\color{red}8.38 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$11.9 \mathrm{ms} \pm 126 \mathrm{μs}\left({\color{lightgreen}-7.288 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$11.4 \mathrm{ms} \pm 74.9 \mathrm{μs}\left({\color{lightgreen}-14.621 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$11.6 \mathrm{ms} \pm 79.9 \mathrm{μs}\left({\color{gray}-0.944 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$11.3 \mathrm{ms} \pm 103 \mathrm{μs}\left({\color{lightgreen}-9.048 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$11.9 \mathrm{ms} \pm 103 \mathrm{μs}\left({\color{gray}-1.405 \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.46 \mathrm{ms} \pm 67.9 \mathrm{μs}\left({\color{lightgreen}-8.441 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$58.6 \mathrm{ms} \pm 565 \mathrm{μs}\left({\color{lightgreen}-7.785 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$115 \mathrm{ms} \pm 764 \mathrm{μs}\left({\color{gray}-3.699 \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.0 \mathrm{ms} \pm 560 \mathrm{μs}\left({\color{lightgreen}-8.020 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$73.7 \mathrm{ms} \pm 565 \mathrm{μs}\left({\color{lightgreen}-9.550 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$82.4 \mathrm{ms} \pm 535 \mathrm{μs}\left({\color{lightgreen}-6.911 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$90.8 \mathrm{ms} \pm 658 \mathrm{μs}\left({\color{gray}-3.774 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$47.8 \mathrm{ms} \pm 279 \mathrm{μs}\left({\color{gray}-0.520 \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 $$79.8 \mathrm{ms} \pm 521 \mathrm{μs}\left({\color{gray}2.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 $$55.5 \mathrm{ms} \pm 409 \mathrm{μs}\left({\color{gray}3.09 \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 $$64.9 \mathrm{ms} \pm 524 \mathrm{μs}\left({\color{gray}3.41 \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 $$67.6 \mathrm{ms} \pm 440 \mathrm{μs}\left({\color{red}5.96 \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 $$67.7 \mathrm{ms} \pm 453 \mathrm{μs}\left({\color{gray}1.19 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$115 \mathrm{ms} \pm 670 \mathrm{μs}\left({\color{gray}1.41 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$127 \mathrm{ms} \pm 718 \mathrm{μs}\left({\color{gray}0.518 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$24.3 \mathrm{ms} \pm 177 \mathrm{μs}\left({\color{gray}-3.429 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$551 \mathrm{ms} \pm 1.63 \mathrm{ms}\left({\color{gray}2.25 \mathrm{\%}}\right) $$ Flame Graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) area/apps area/deps Relates to third-party dependencies (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

2 participants