Skip to content

BE-640: Fix cargo unused_dependencies warnings and surface them in CI#8963

Open
TimDiekmann wants to merge 1 commit into
mainfrom
t/be-640-rust-fix-cargounused_dependencies-warnings-across-the
Open

BE-640: Fix cargo unused_dependencies warnings and surface them in CI#8963
TimDiekmann wants to merge 1 commit into
mainfrom
t/be-640-rust-fix-cargounused_dependencies-warnings-across-the

Conversation

@TimDiekmann

@TimDiekmann TimDiekmann commented Jul 6, 2026

Copy link
Copy Markdown
Member

🌟 What is the purpose of this PR?

Cargo's unused_dependencies lint (active through the repo's cargo-lints opt-in since at least nightly-2026-06-08) has been reporting unused dependencies for weeks, but nobody saw/complained about it: the warnings are cargo manifest diagnostics emitted as plain text, not compiler JSON messages, so they bypass the SARIF gate in CI and only ever existed in unread logs of green jobs. Locally they are equally easy to miss because cargo only reports them for primary packages of an invocation.

This PR fixes every current finding across the workspace and adds a CI gate so new ones fail the lint job.

🔗 Related links

🚫 Blocked by

Nothing.

🔍 What does this change?

  • 38 crates: replace #![cfg_attr(doc, doc = simple_mermaid::mermaid!(…))] with an unconditional #![doc = …]. The dependency is compiled in every build anyway and doc attributes are inert outside rustdoc, but the cfg_attr variant made every non-doc build consider simple-mermaid unused.
  • Remove genuinely unused dependencies (zero usages in the respective crate): reqwest, futures, futures-core (hash-graph-authorization), rpds (hashql-core), derive_more (hashql-diagnostics), opentelemetry_sdk (hash-graph-api), futures (type-system).
  • hash-graph-type-fetcher: declare the reqwest/stream feature itself. It uses Response::bytes_stream but previously only compiled because hash-graph-authorization's (unused) reqwest dependency enabled the feature via unification.
  • error-stack: anchor spin with a use spin as _; gated on all(feature = "std", feature = "hooks") — it is genuinely used, but only on no-std paths, so std + hooks builds flagged it. A per-crate [lints.cargo] override is not possible next to lints.workspace = true.
  • hash-telemetry: make clap_builder optional and wire it into the clap feature; it is only referenced by the clap::Args derives behind that feature.
  • CI (lint.yml): tee the clippy stream into clippy-output.log and fail the step when it contains warning: unused dependency or (manifest) generated lines. This catches all cargo manifest lints with zero additional build time. A workspace-wide deny level was deliberately rejected because it would make local builds fail mid-refactor.

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
    • error-stack is touched, but only with a comment and a cfg-gated import anchor; no behaviour or API change, no version bump needed

📜 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:

  • do not affect the execution graph

⚠️ Known issues

  • The PR-mode clippy run uses --all-features, which by construction cannot detect dependencies that are unused only in some feature combinations (the clap_builder class). Those are still caught by the cargo hack --feature-powerset run outside of pull requests.
  • Manifest lint findings fail the step with plain log output; they do not appear as code-scanning annotations, since clippy-sarif has no JSON events to convert.

🐾 Next steps

  • Once cargo emits its own lints via --message-format=json (the lint system is still unstable), the grep gate can be folded into the SARIF pipeline.

🛡 What tests cover this?

  • cargo check --workspace --all-features is warning-free (run to fixpoint locally).
  • cargo check -p error-stack --all-features and --no-default-features --features hooks both clean.
  • The CI grep gate was verified against real turbo output: positive test (stashed fix) matches and exits 1, negative test (this branch) matches nothing.

❓ How to test this?

  1. Checkout the branch.
  2. Run cargo clean && cargo check --workspace --all-features — no unused dependency warnings appear.
  3. To see the CI gate fire, add an unused dependency to any crate's Cargo.toml and push — the "Run clippy" step for that package fails with the offending lines in the log.

📹 Demo

@rust/hash-telemetry:lint:clippy: warning: unused dependency
@rust/hash-telemetry:lint:clippy:   --> libs/@local/telemetry/Cargo.toml:32:1
@rust/hash-telemetry:lint:clippy: warning: `hash-telemetry` (manifest) generated 1 warning
→ step exits 1

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment Jul 6, 2026 2:13pm
hashdotdesign-tokens Ready Ready Preview, Comment Jul 6, 2026 2:13pm
petrinaut Ready Ready Preview, Comment Jul 6, 2026 2:13pm

@github-actions github-actions Bot added area/deps Relates to third-party dependencies (area) area/apps > hash* Affects HASH (a `hash-*` app) area/infra Relates to version control, CI, CD or IaC (area) area/libs > error-stack Affects the `error-stack` crate (library) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team area/tests New or updated tests area/apps area/apps > hash-graph labels Jul 6, 2026
@TimDiekmann TimDiekmann added area/deps Relates to third-party dependencies (area) area/apps > hash* Affects HASH (a `hash-*` app) area/infra Relates to version control, CI, CD or IaC (area) area/libs > error-stack Affects the `error-stack` crate (library) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team area/tests New or updated tests area/apps area/apps > hash-graph labels Jul 6, 2026
@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Mostly manifest and doc-attribute cleanup plus CI grep; the type-fetcher reqwest feature change is a small, explicit dependency fix with no API changes.

Overview
Clears workspace-wide cargo::unused_dependencies warnings and makes them visible in CI, where they previously slipped past the SARIF-only clippy gate.

Across ~38 crates, dependency diagrams are embedded with unconditional #![doc = simple_mermaid::mermaid!(…)] instead of #![cfg_attr(doc, …)], so simple-mermaid counts as used in normal builds. Unused manifest entries are dropped where nothing references them (e.g. futures / reqwest on hash-graph-authorization, opentelemetry_sdk on hash-graph-api, rpds / derive_more on HashQL crates, futures on type-system). hash-graph-type-fetcher now enables reqwest/stream explicitly for bytes_stream. hash-telemetry makes clap_builder optional behind the clap feature. error-stack adds a cfg-gated use spin as _ so std+hooks builds do not flag spin.

lint.yml tees clippy JSON output to clippy-output.log and fails the step if that log matches manifest warnings (unused dependency / (manifest) generated).

Reviewed by Cursor Bugbot for commit e5ffd02. 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.

Pull request overview

This PR addresses persistent Rust cargo::unused_dependencies manifest warnings across the workspace and ensures they’re surfaced as CI failures, preventing them from silently accumulating in green builds.

Changes:

  • Updates many Rust crates to use an unconditional #![doc = simple_mermaid::mermaid!(…)] attribute so simple-mermaid is considered “used” in non-doc builds.
  • Removes or rewires unused/misconfigured dependencies and features (e.g., reqwest/stream, optional clap_builder, removal of unused crates).
  • Adds a CI gate in lint.yml to detect manifest-lint warnings from clippy output logs and fail the job.

Reviewed changes

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

Show a summary per file
File Description
tests/graph/test-data/rust/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/error-stack/src/fmt/hook.rs Anchor spin in std + hooks builds to satisfy unused-dep lint.
libs/@local/temporal-client/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/telemetry/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/telemetry/Cargo.toml Make clap_builder optional and tie it to the clap feature.
libs/@local/status/rust/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/repo-chores/rust/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/hashql/syntax-jexpr/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/hashql/mir/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/hashql/hir/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/hashql/eval/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/hashql/diagnostics/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/hashql/diagnostics/Cargo.toml Remove unused derive_more dependency.
libs/@local/hashql/core/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/hashql/core/Cargo.toml Remove unused rpds dependency.
libs/@local/hashql/compiletest/src/main.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/hashql/compiletest/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/hashql/ast/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/harpc/wire-protocol/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/harpc/types/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/harpc/tower/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/harpc/system/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/harpc/server/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/harpc/net/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/harpc/codec/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/harpc/client/rust/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/graph/validation/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/graph/types/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/graph/type-fetcher/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/graph/type-fetcher/Cargo.toml Explicitly enable reqwest’s stream feature.
libs/@local/graph/type-defs/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/graph/temporal-versioning/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/graph/store/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/graph/postgres-store/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/graph/migrations/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/graph/migrations-macros/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/graph/authorization/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/graph/authorization/Cargo.toml Remove unused reqwest, futures, and futures-core dependencies.
libs/@local/graph/api/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/graph/api/Cargo.toml Remove unused opentelemetry_sdk dependency.
libs/@local/effect-dns/hickory/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/codegen/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@local/codec/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@blockprotocol/type-system/rust/src/lib.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
libs/@blockprotocol/type-system/rust/Cargo.toml Remove unused futures dependency.
Cargo.lock Update lockfile to reflect dependency removals/feature changes.
apps/hash-graph/src/main.rs Make mermaid doc attribute unconditional to avoid unused-dep manifest lint.
.github/workflows/lint.yml Tee clippy output for grep-based manifest-lint gating in CI.

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

Comment on lines 139 to 141
run: |
pushd ${{ matrix.path }}
turbo run lint:clippy --filter "${{ matrix.name }}" -- --message-format=json \
@codspeed-hq

codspeed-hq Bot commented Jul 6, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 80 untouched benchmarks


Comparing t/be-640-rust-fix-cargounused_dependencies-warnings-across-the (e5ffd02) with main (3db2f69)

Open in CodSpeed

@github-actions

github-actions Bot commented Jul 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 $$27.2 \mathrm{ms} \pm 248 \mathrm{μs}\left({\color{gray}0.418 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.41 \mathrm{ms} \pm 16.6 \mathrm{μs}\left({\color{gray}-1.484 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1002 $$12.1 \mathrm{ms} \pm 85.7 \mathrm{μs}\left({\color{gray}-0.401 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$43.4 \mathrm{ms} \pm 340 \mathrm{μs}\left({\color{gray}2.10 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$13.7 \mathrm{ms} \pm 125 \mathrm{μs}\left({\color{gray}-1.454 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1527 $$23.4 \mathrm{ms} \pm 190 \mathrm{μs}\left({\color{gray}0.649 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$28.0 \mathrm{ms} \pm 208 \mathrm{μs}\left({\color{gray}-0.233 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.75 \mathrm{ms} \pm 21.9 \mathrm{μs}\left({\color{gray}0.551 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$13.1 \mathrm{ms} \pm 98.3 \mathrm{μs}\left({\color{gray}-0.043 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.80 \mathrm{ms} \pm 20.9 \mathrm{μs}\left({\color{gray}-0.145 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.98 \mathrm{ms} \pm 19.6 \mathrm{μs}\left({\color{gray}-1.235 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 52 $$3.37 \mathrm{ms} \pm 17.6 \mathrm{μs}\left({\color{gray}0.295 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.22 \mathrm{ms} \pm 40.9 \mathrm{μs}\left({\color{gray}0.644 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.51 \mathrm{ms} \pm 15.7 \mathrm{μs}\left({\color{gray}-1.759 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 108 $$4.13 \mathrm{ms} \pm 26.5 \mathrm{μs}\left({\color{gray}-0.473 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.43 \mathrm{ms} \pm 28.4 \mathrm{μs}\left({\color{gray}-0.182 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.45 \mathrm{ms} \pm 25.1 \mathrm{μs}\left({\color{gray}-0.499 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.14 \mathrm{ms} \pm 31.9 \mathrm{μs}\left({\color{gray}0.547 \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 16.2 \mathrm{μs}\left({\color{gray}0.266 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.53 \mathrm{ms} \pm 18.7 \mathrm{μs}\left({\color{gray}0.662 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 2 $$2.57 \mathrm{ms} \pm 13.9 \mathrm{μs}\left({\color{gray}-0.877 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.85 \mathrm{ms} \pm 15.3 \mathrm{μs}\left({\color{gray}-1.647 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.67 \mathrm{ms} \pm 17.6 \mathrm{μs}\left({\color{gray}1.06 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.84 \mathrm{ms} \pm 16.0 \mathrm{μs}\left({\color{gray}0.203 \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 17.1 \mathrm{μs}\left({\color{gray}0.048 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.75 \mathrm{ms} \pm 13.1 \mathrm{μs}\left({\color{gray}0.052 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 26 $$3.01 \mathrm{ms} \pm 16.8 \mathrm{μs}\left({\color{gray}2.17 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.46 \mathrm{ms} \pm 22.8 \mathrm{μs}\left({\color{gray}-0.111 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.98 \mathrm{ms} \pm 17.7 \mathrm{μs}\left({\color{gray}-0.655 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 27 $$3.29 \mathrm{ms} \pm 15.3 \mathrm{μs}\left({\color{gray}0.906 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.44 \mathrm{ms} \pm 27.4 \mathrm{μs}\left({\color{gray}1.23 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.97 \mathrm{ms} \pm 19.4 \mathrm{μs}\left({\color{gray}-0.672 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.36 \mathrm{ms} \pm 19.5 \mathrm{μs}\left({\color{gray}0.295 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$42.0 \mathrm{ms} \pm 243 \mathrm{μs}\left({\color{gray}1.41 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$32.5 \mathrm{ms} \pm 191 \mathrm{μs}\left({\color{gray}0.980 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$35.2 \mathrm{ms} \pm 230 \mathrm{μs}\left({\color{gray}0.548 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$31.7 \mathrm{ms} \pm 193 \mathrm{μs}\left({\color{gray}1.54 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$41.4 \mathrm{ms} \pm 250 \mathrm{μs}\left({\color{gray}1.16 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$49.6 \mathrm{ms} \pm 216 \mathrm{μs}\left({\color{gray}1.42 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$40.2 \mathrm{ms} \pm 198 \mathrm{μs}\left({\color{gray}0.933 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$85.5 \mathrm{ms} \pm 550 \mathrm{μs}\left({\color{lightgreen}-6.446 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$33.1 \mathrm{ms} \pm 204 \mathrm{μs}\left({\color{gray}0.467 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$276 \mathrm{ms} \pm 1.09 \mathrm{ms}\left({\color{red}8.20 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$10.5 \mathrm{ms} \pm 63.7 \mathrm{μs}\left({\color{gray}0.533 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$10.6 \mathrm{ms} \pm 60.2 \mathrm{μs}\left({\color{gray}0.037 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$10.6 \mathrm{ms} \pm 65.1 \mathrm{μs}\left({\color{gray}0.105 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$10.5 \mathrm{ms} \pm 53.2 \mathrm{μs}\left({\color{gray}-0.015 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$10.7 \mathrm{ms} \pm 65.3 \mathrm{μs}\left({\color{gray}0.957 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$10.5 \mathrm{ms} \pm 66.1 \mathrm{μs}\left({\color{gray}0.542 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$10.6 \mathrm{ms} \pm 66.9 \mathrm{μs}\left({\color{gray}1.57 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$10.6 \mathrm{ms} \pm 67.1 \mathrm{μs}\left({\color{gray}-0.646 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$10.6 \mathrm{ms} \pm 55.5 \mathrm{μs}\left({\color{gray}0.273 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$10.7 \mathrm{ms} \pm 74.8 \mathrm{μs}\left({\color{gray}0.112 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity

Function Value Mean Flame graphs
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$10.9 \mathrm{ms} \pm 57.9 \mathrm{μs}\left({\color{gray}0.135 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$10.9 \mathrm{ms} \pm 49.0 \mathrm{μs}\left({\color{gray}-0.398 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$10.9 \mathrm{ms} \pm 64.8 \mathrm{μs}\left({\color{gray}0.234 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$10.9 \mathrm{ms} \pm 64.8 \mathrm{μs}\left({\color{gray}-0.261 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$10.8 \mathrm{ms} \pm 50.1 \mathrm{μs}\left({\color{gray}-0.623 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$11.0 \mathrm{ms} \pm 63.2 \mathrm{μs}\left({\color{gray}0.105 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$10.9 \mathrm{ms} \pm 73.9 \mathrm{μs}\left({\color{gray}0.241 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$11.1 \mathrm{ms} \pm 67.6 \mathrm{μs}\left({\color{gray}0.597 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$10.9 \mathrm{ms} \pm 63.0 \mathrm{μs}\left({\color{gray}-0.607 \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.66 \mathrm{ms} \pm 50.1 \mathrm{μs}\left({\color{gray}0.522 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$54.3 \mathrm{ms} \pm 410 \mathrm{μs}\left({\color{lightgreen}-10.056 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$108 \mathrm{ms} \pm 554 \mathrm{μs}\left({\color{gray}-3.575 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$61.2 \mathrm{ms} \pm 543 \mathrm{μs}\left({\color{lightgreen}-6.138 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$69.4 \mathrm{ms} \pm 503 \mathrm{μs}\left({\color{lightgreen}-7.579 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$79.3 \mathrm{ms} \pm 654 \mathrm{μs}\left({\color{lightgreen}-5.567 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$86.1 \mathrm{ms} \pm 442 \mathrm{μs}\left({\color{lightgreen}-5.007 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$42.9 \mathrm{ms} \pm 317 \mathrm{μs}\left({\color{gray}-1.783 \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 $$73.3 \mathrm{ms} \pm 578 \mathrm{μs}\left({\color{gray}-0.801 \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 $$49.6 \mathrm{ms} \pm 348 \mathrm{μs}\left({\color{gray}-1.211 \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 $$58.6 \mathrm{ms} \pm 471 \mathrm{μs}\left({\color{gray}-2.148 \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 $$62.2 \mathrm{ms} \pm 515 \mathrm{μs}\left({\color{gray}-0.221 \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 $$61.6 \mathrm{ms} \pm 457 \mathrm{μs}\left({\color{gray}-1.076 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$125 \mathrm{ms} \pm 825 \mathrm{μs}\left({\color{gray}3.34 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$135 \mathrm{ms} \pm 802 \mathrm{μs}\left({\color{gray}1.50 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$18.0 \mathrm{ms} \pm 105 \mathrm{μs}\left({\color{lightgreen}-23.466 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$560 \mathrm{ms} \pm 1.45 \mathrm{ms}\left({\color{gray}4.75 \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-graph area/apps area/deps Relates to third-party dependencies (area) area/infra Relates to version control, CI, CD or IaC (area) area/libs > error-stack Affects the `error-stack` crate (library) 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