Skip to content

SRE-733: Build backend images only when affected (turbo-driven matrix)#8784

Open
TimDiekmann wants to merge 3 commits into
t/sre-728-publish-images-to-ghcrfrom
t/sre-733-turbo-affected-matrix-for-backend-image-builds-in-deployyml
Open

SRE-733: Build backend images only when affected (turbo-driven matrix)#8784
TimDiekmann wants to merge 3 commits into
t/sre-728-publish-images-to-ghcrfrom
t/sre-733-turbo-affected-matrix-for-backend-image-builds-in-deployyml

Conversation

@TimDiekmann
Copy link
Copy Markdown
Member

@TimDiekmann TimDiekmann commented May 29, 2026

🌟 What is the purpose of this PR?

Make the backend image pipeline (introduced in #8781 / SRE-728) only build, publish, and deploy the services whose source actually changed, instead of rebuilding all of them on every event. The build / manifest / deploy matrices are now derived from a turbo affectedPackages query against a single in-workflow service catalog.

🔗 Related links

🚫 Blocked by

🔍 What does this change?

  • The setup job holds a single CATALOG as the source of truth — per service: service, push targets, dockerfile, context, optional build_args, ecs[] (the ECS task definitions that service drives), and a detection key: package for app images (turbo workspace package) or paths for infra images. From it, setup emits three matrices via jq: backend-images, backend-manifests, backend-deploys.
  • Two-pronged change detection: app images (graph/api/frontend/workers) via turbo's affected-package query (build:docker task filter, dependency-aware — a shared-lib change rebuilds its dependents); Kratos/Hydra via git diff of their context directory. Kratos and Hydra aren't JS packages, so turbo can't see them — but their image build context is their own directory, so a git diff of paths is a complete, correct change signal. The workspace-root // is filtered out of the turbo result.
  • workflow_dispatch rebuilds everything (manual re-trigger); pull_request / push(main) / merge_group filter to the affected set. amd64 builds are dropped at matrix-construction time on PRs.
  • A MISSING guard hard-fails the setup step if turbo flags a build:docker package that isn't in the catalog — so a newly-added image can never silently fail to publish.
  • build / manifest / deploy consume the dynamic matrices and gate on fromJSON(needs.setup.outputs.…).…[0] != null; the passed gate tolerates skipped matrix jobs (a PR that touches no backend image leaves them all skipped and still passes).
  • set -euo pipefail on the setup step: a failing turbo query | jq would otherwise be masked by jq's exit 0 on empty input, yielding an empty matrix and a green run that silently builds/deploys nothing.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

  • affected the execution graph (two new build:docker packages), but no turbo.json change was needed — the stub packages inherit the root build:docker task config and turbo's default inputs.

⚠️ Known issues

  • The CATALOG uses jq's unquoted-key object syntax (it's a jq program, not a JSON file) for readability — intentional, parses correctly.

🧹 Also in this PR

  • Closed a pre-existing Slack-notify gap on main. The old separate notify-slack-deploy job keyed on failure() of deploy, so a build failure (which skips deploy rather than failing it) produced no Slack alert — and setup/manifest failures were never covered at all. Folded the notification into the passed gate, whose Check steps span every pipeline job, so any failure on main now pings @infra (and merge-queue failures still ping @devops).

🐾 Next steps

  • The base: HEAD^ turbo base is correct for push/PR but under-reports in merge_group with multiple stacked PRs; worth revisiting if the queue regularly batches backend changes.

🛡 What tests cover this?

No automated tests — the workflow is the test surface. The jq matrix pipelines, the empty-set gates, the ECS-target mapping (vs. the pre-refactor static matrix), and turbo's stub-package detection were validated by executing jq/turbo/git against the real catalog across PR / push / dispatch / single-service / ECR-only / empty scenarios.

❓ How to test this?

  1. PR (build-only): this PR's own run builds only the affected services' arm64 images, pushes nothing; manifest/deploy skip; Deployments passed is green.
  2. Affected detection: a PR touching only apps/hash-api/** should build only api; one touching only infra/compose/kratos/** should build only kratos.
  3. Dispatch: gh workflow run deploy.yml --ref <branch> rebuilds the full catalog and (on non-main) pushes the multi-arch GHCR tags end-to-end.
  4. After merge to main: only changed services build → push ECR/GHCR → ECS redeploys their mapped task definitions.

Replace the static service list in the backend build/manifest/deploy
matrices with a turbo affected-package query, so PRs and main pushes
only build/publish the images whose source actually changed.

- `setup` job holds a single `CATALOG` (per service: package, service,
  push targets, dockerfile, context, optional build_args, ecs[]) as the
  source of truth, and emits three matrices — `backend-images`,
  `backend-manifests`, `backend-deploys` — via jq. workflow_dispatch
  rebuilds everything; PR/push/merge_group filter to turbo's affected
  set. A MISSING guard hard-fails if turbo flags a build:docker package
  absent from the catalog (prevents a silent no-publish).
- build/manifest/deploy consume the dynamic matrices and gate on
  `fromJSON(...).…[0] != null`. amd64 PR builds are skipped at
  matrix-construction time; the `passed` gate tolerates skipped jobs.
- New workspace stub packages `infra/compose/{kratos,hydra}` (each a
  `build:docker` script + LICENSE.md) let turbo attribute Dockerfile /
  context changes to a package; registered in root workspaces.
- `set -euo pipefail` on the setup step so a failing `turbo query | jq`
  fails loud instead of yielding an empty matrix and a green no-op run.
The standalone `notify-slack-deploy` job keyed on `failure()` of the
`deploy` job only. When `build` fails, `deploy` is *skipped* (its needs
aren't met) rather than failing — and a skipped job is not a failure —
so no Slack alert fired. `setup` and `manifest` failures were never
covered either.

Fold the notification into the `passed` gate instead. Its Check steps
already span setup/sourcemaps/build/manifest/deploy, so a step-level
`failure()` fires whenever any of them fails. Two mutually-exclusive
Slack steps gate by event: main push/dispatch → @infra, merge_group →
@devops. Removes the now-redundant `notify-slack-deploy` job.
@TimDiekmann TimDiekmann requested a review from a team as a code owner May 29, 2026 08:49
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

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

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment May 29, 2026 9:39am
hashdotdesign-tokens Ready Ready Preview, Comment May 29, 2026 9:39am
petrinaut Ready Ready Preview, Comment May 29, 2026 9:39am

@cursor
Copy link
Copy Markdown

cursor Bot commented May 29, 2026

PR Summary

High Risk
Changes staging CD scope (which images publish and which ECS services redeploy) and auth-adjacent Kratos/Hydra detection; mis-filtering could skip required deploys or leave catalog drift undetected until setup fails.

Overview
The Deploy workflow no longer uses fixed build/manifest/deploy matrices for every backend service. A setup job now owns a single service catalog (Docker paths, registries, ECS targets) and emits backend-images, backend-manifests, and backend-deploys after filtering to what actually changed.

On normal runs, Turbo affectedPackages (build:docker, HEAD^) selects app images (dependency-aware); Kratos/Hydra use git diff under their compose dirs. workflow_dispatch still rebuilds the full catalog. The setup step uses set -euo pipefail and fails if Turbo reports a build:docker package missing from the catalog. PR runs drop amd64 at matrix build time; jobs skip when matrices are empty, and Deployments passed treats skipped build as OK.

Build no longer uses per-job should_build gating—the dynamic matrix decides what runs; Compute targets only chooses push/tags. Slack failure alerts move from a deploy-only job into passed, so failures in setup/build/manifest (and skipped deploy after a failed build) still notify on main.

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

@github-actions github-actions Bot added area/deps Relates to third-party dependencies (area) area/infra Relates to version control, CI, CD or IaC (area) type/legal Owned by the @legal team labels May 29, 2026
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 29, 2026

🤖 Augment PR Summary

Summary: This PR updates the backend deploy workflow to only build/publish/deploy Docker images for services affected by the change set, using Turbo’s affected-package query.

Changes:

  • Introduces a single in-workflow service CATALOG and derives dynamic matrices for image builds, GHCR multi-arch manifests, and ECS redeploys via turbo query + jq.
  • Adds a hard-fail “missing from catalog” guard so new build:docker packages can’t be silently skipped.
  • Skips amd64 builds on PRs and avoids creating matrices/jobs when the affected set is empty.
  • Updates build, manifest, and deploy jobs to consume the new matrices and gate on non-empty outputs.
  • Adds stub workspace packages under infra/compose/{hydra,kratos} so Turbo can attribute Dockerfile/context changes for those images.
  • Moves Slack failure notification into the stable passed gate job to catch failures across setup/build/manifest/deploy (including skipped downstream jobs).

🤖 Was this summary useful? React with 👍 or 👎

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.

Comment thread .github/workflows/deploy.yml Outdated
The stub packages `@infra/compose-{kratos,hydra}` were added so turbo's
affected-package query would attribute Dockerfile/context changes to a
package. But forcing non-JS infra directories into the yarn workspace
collided with the monorepo tooling:

- `prune-repository` does `cp -R infra/ out/`, so the pruned workspace
  contained the stub package.json files while `turbo prune` omitted them
  from the pruned lockfile → `yarn install --immutable` wanted to add
  them → YN0028 ("lockfile would be modified"), failing every Lint and
  Package job.
- They also spawned spurious `Package (@infra/compose-*)` lint jobs.

Kratos and Hydra aren't JS packages — their image build context is their
own directory, so `git diff --name-only HEAD^ HEAD` of that dir is a
complete, correct change signal (no dependency closure to track). Detect
app images via turbo (dependency-aware) and infra images via git diff;
catalog entries carry either `package` or `paths`.

Also filter the workspace root `//` out of the turbo affected list so the
MISSING guard can't hard-fail on it (matches the sourcemaps query).

Removes the four stub files and the two workspace entries; regenerates
the lockfile without the `@infra/compose-*` resolutions.
@github-actions github-actions Bot removed area/deps Relates to third-party dependencies (area) type/legal Owned by the @legal team labels May 29, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.01%. Comparing base (e55a185) to head (f48ff08).

Additional details and impacted files
@@                        Coverage Diff                        @@
##           t/sre-728-publish-images-to-ghcr    #8784   +/-   ##
=================================================================
  Coverage                             59.01%   59.01%           
=================================================================
  Files                                  1342     1342           
  Lines                                129455   129455           
  Branches                               5849     5849           
=================================================================
+ Hits                                  76395    76396    +1     
+ Misses                                52159    52158    -1     
  Partials                                901      901           
Flag Coverage Δ
apps.hash-ai-worker-ts 1.41% <ø> (ø)
apps.hash-api 0.00% <ø> (ø)
blockprotocol.type-system 40.84% <ø> (ø)
local.claude-hooks 0.00% <ø> (ø)
local.harpc-client 51.24% <ø> (ø)
local.hash-backend-utils 2.81% <ø> (ø)
local.hash-graph-sdk 9.63% <ø> (ø)
local.hash-isomorphic-utils 0.00% <ø> (ø)
rust.antsi 0.00% <ø> (ø)
rust.error-stack 90.87% <ø> (ø)
rust.harpc-codec 84.70% <ø> (ø)
rust.harpc-net 96.19% <ø> (+0.01%) ⬆️
rust.harpc-tower 67.03% <ø> (ø)
rust.harpc-types 0.00% <ø> (ø)
rust.harpc-wire-protocol 92.23% <ø> (ø)
rust.hash-codec 72.76% <ø> (ø)
rust.hash-graph-api 2.52% <ø> (ø)
rust.hash-graph-authorization 62.34% <ø> (ø)
rust.hash-graph-postgres-store 26.74% <ø> (ø)
rust.hash-graph-store 37.76% <ø> (ø)
rust.hash-graph-temporal-versioning 47.95% <ø> (ø)
rust.hash-graph-types 0.00% <ø> (ø)
rust.hash-graph-validation 83.45% <ø> (ø)
rust.hashql-ast 87.23% <ø> (ø)
rust.hashql-compiletest 28.26% <ø> (ø)
rust.hashql-core 79.32% <ø> (ø)
rust.hashql-diagnostics 72.53% <ø> (ø)
rust.hashql-eval 75.69% <ø> (ø)
rust.hashql-hir 89.06% <ø> (ø)
rust.hashql-mir 86.74% <ø> (ø)
rust.hashql-syntax-jexpr 94.06% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 29, 2026

Merging this PR will not alter performance

✅ 80 untouched benchmarks


Comparing t/sre-733-turbo-affected-matrix-for-backend-image-builds-in-deployyml (f48ff08) with t/sre-728-publish-images-to-ghcr (e55a185)

Open in CodSpeed

@TimDiekmann TimDiekmann requested review from a team and removed request for a team May 29, 2026 10:02
@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 $$28.3 \mathrm{ms} \pm 182 \mathrm{μs}\left({\color{red}6.65 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.52 \mathrm{ms} \pm 16.9 \mathrm{μs}\left({\color{gray}2.61 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1001 $$12.9 \mathrm{ms} \pm 120 \mathrm{μs}\left({\color{gray}4.84 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$43.7 \mathrm{ms} \pm 357 \mathrm{μs}\left({\color{gray}-0.073 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$15.7 \mathrm{ms} \pm 153 \mathrm{μs}\left({\color{gray}-4.283 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1526 $$23.9 \mathrm{ms} \pm 201 \mathrm{μs}\left({\color{lightgreen}-9.227 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$27.3 \mathrm{ms} \pm 205 \mathrm{μs}\left({\color{gray}0.240 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.91 \mathrm{ms} \pm 22.5 \mathrm{μs}\left({\color{gray}3.32 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$13.7 \mathrm{ms} \pm 104 \mathrm{μs}\left({\color{gray}2.43 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.77 \mathrm{ms} \pm 31.0 \mathrm{μs}\left({\color{gray}-0.778 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.11 \mathrm{ms} \pm 39.5 \mathrm{μs}\left({\color{gray}2.01 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 51 $$3.37 \mathrm{ms} \pm 25.2 \mathrm{μs}\left({\color{gray}-1.338 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.10 \mathrm{ms} \pm 30.1 \mathrm{μs}\left({\color{gray}-1.334 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.55 \mathrm{ms} \pm 17.6 \mathrm{μs}\left({\color{gray}-0.309 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 107 $$4.09 \mathrm{ms} \pm 25.2 \mathrm{μs}\left({\color{gray}-0.286 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.47 \mathrm{ms} \pm 44.7 \mathrm{μs}\left({\color{gray}1.52 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.51 \mathrm{ms} \pm 22.7 \mathrm{μs}\left({\color{gray}-0.450 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.03 \mathrm{ms} \pm 19.7 \mathrm{μs}\left({\color{gray}-0.992 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.61 \mathrm{ms} \pm 13.3 \mathrm{μs}\left({\color{gray}-3.045 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.54 \mathrm{ms} \pm 15.2 \mathrm{μs}\left({\color{gray}0.800 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1 $$2.61 \mathrm{ms} \pm 12.7 \mathrm{μs}\left({\color{gray}-2.314 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.85 \mathrm{ms} \pm 14.0 \mathrm{μs}\left({\color{gray}-2.837 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.67 \mathrm{ms} \pm 16.4 \mathrm{μs}\left({\color{gray}-2.369 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.86 \mathrm{ms} \pm 17.1 \mathrm{μs}\left({\color{gray}-3.040 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.06 \mathrm{ms} \pm 19.6 \mathrm{μs}\left({\color{gray}-1.223 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.81 \mathrm{ms} \pm 16.2 \mathrm{μs}\left({\color{gray}-1.633 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 25 $$3.07 \mathrm{ms} \pm 25.2 \mathrm{μs}\left({\color{gray}-0.563 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.40 \mathrm{ms} \pm 19.3 \mathrm{μs}\left({\color{gray}0.174 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.09 \mathrm{ms} \pm 43.2 \mathrm{μs}\left({\color{gray}4.60 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 26 $$3.30 \mathrm{ms} \pm 17.9 \mathrm{μs}\left({\color{gray}1.23 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.32 \mathrm{ms} \pm 21.7 \mathrm{μs}\left({\color{gray}-1.402 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.02 \mathrm{ms} \pm 18.1 \mathrm{μs}\left({\color{gray}1.92 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.32 \mathrm{ms} \pm 19.6 \mathrm{μs}\left({\color{gray}2.12 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$54.2 \mathrm{ms} \pm 304 \mathrm{μs}\left({\color{gray}0.734 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$46.7 \mathrm{ms} \pm 229 \mathrm{μs}\left({\color{gray}-0.027 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$51.1 \mathrm{ms} \pm 276 \mathrm{μs}\left({\color{gray}2.14 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$54.2 \mathrm{ms} \pm 1.33 \mathrm{ms}\left({\color{red}23.0 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$62.7 \mathrm{ms} \pm 338 \mathrm{μs}\left({\color{gray}2.09 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$60.9 \mathrm{ms} \pm 304 \mathrm{μs}\left({\color{gray}-1.570 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$56.1 \mathrm{ms} \pm 339 \mathrm{μs}\left({\color{gray}-0.495 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$102 \mathrm{ms} \pm 519 \mathrm{μs}\left({\color{gray}0.070 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$52.9 \mathrm{ms} \pm 2.77 \mathrm{ms}\left({\color{red}15.0 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$293 \mathrm{ms} \pm 985 \mathrm{μs}\left({\color{red}9.03 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$19.1 \mathrm{ms} \pm 106 \mathrm{μs}\left({\color{gray}-1.424 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$20.1 \mathrm{ms} \pm 134 \mathrm{μs}\left({\color{gray}0.555 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$20.4 \mathrm{ms} \pm 112 \mathrm{μs}\left({\color{gray}0.657 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$19.5 \mathrm{ms} \pm 142 \mathrm{μs}\left({\color{gray}1.49 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$25.4 \mathrm{ms} \pm 141 \mathrm{μs}\left({\color{gray}-0.221 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$19.3 \mathrm{ms} \pm 101 \mathrm{μs}\left({\color{gray}-0.759 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$19.3 \mathrm{ms} \pm 107 \mathrm{μs}\left({\color{gray}-1.065 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$19.3 \mathrm{ms} \pm 91.0 \mathrm{μs}\left({\color{gray}-2.393 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$20.3 \mathrm{ms} \pm 116 \mathrm{μs}\left({\color{gray}0.220 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$26.8 \mathrm{ms} \pm 196 \mathrm{μs}\left({\color{gray}0.395 \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.2 \mathrm{ms} \pm 263 \mathrm{μs}\left({\color{gray}0.173 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$34.9 \mathrm{ms} \pm 290 \mathrm{μs}\left({\color{gray}0.576 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$34.6 \mathrm{ms} \pm 269 \mathrm{μs}\left({\color{gray}1.01 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$35.6 \mathrm{ms} \pm 327 \mathrm{μs}\left({\color{gray}4.33 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$34.6 \mathrm{ms} \pm 277 \mathrm{μs}\left({\color{gray}3.27 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$34.1 \mathrm{ms} \pm 271 \mathrm{μs}\left({\color{gray}-0.378 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$34.6 \mathrm{ms} \pm 282 \mathrm{μs}\left({\color{gray}1.44 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$35.0 \mathrm{ms} \pm 267 \mathrm{μs}\left({\color{gray}4.20 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$34.7 \mathrm{ms} \pm 287 \mathrm{μs}\left({\color{gray}0.559 \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 56.0 \mathrm{μs}\left({\color{gray}0.525 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$90.7 \mathrm{ms} \pm 477 \mathrm{μs}\left({\color{gray}0.414 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$148 \mathrm{ms} \pm 888 \mathrm{μs}\left({\color{gray}3.57 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$98.6 \mathrm{ms} \pm 580 \mathrm{μs}\left({\color{gray}2.27 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$109 \mathrm{ms} \pm 553 \mathrm{μs}\left({\color{gray}1.80 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$118 \mathrm{ms} \pm 650 \mathrm{μs}\left({\color{gray}4.20 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$127 \mathrm{ms} \pm 821 \mathrm{μs}\left({\color{gray}3.99 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$104 \mathrm{ms} \pm 578 \mathrm{μs}\left({\color{gray}3.46 \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 $$134 \mathrm{ms} \pm 578 \mathrm{μs}\left({\color{gray}3.42 \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 $$112 \mathrm{ms} \pm 560 \mathrm{μs}\left({\color{gray}2.99 \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 582 \mathrm{μs}\left({\color{gray}3.01 \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 635 \mathrm{μs}\left({\color{gray}4.03 \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 $$122 \mathrm{ms} \pm 722 \mathrm{μs}\left({\color{gray}2.67 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$190 \mathrm{ms} \pm 1.07 \mathrm{ms}\left({\color{red}34.6 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$151 \mathrm{ms} \pm 1.08 \mathrm{ms}\left({\color{gray}1.23 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$39.9 \mathrm{ms} \pm 244 \mathrm{μs}\left({\color{gray}-1.166 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$567 \mathrm{ms} \pm 1.10 \mathrm{ms}\left({\color{gray}-1.620 \mathrm{\%}}\right) $$ Flame Graph

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

Labels

area/infra Relates to version control, CI, CD or IaC (area)

Development

Successfully merging this pull request may close these issues.

2 participants