Skip to content

H-6498: Increase printWidth across oxfmt to 100#8745

Open
indietyp wants to merge 2 commits into
mainfrom
bm/h-6498-increase-line-width-to-100-across-the-js-libraries
Open

H-6498: Increase printWidth across oxfmt to 100#8745
indietyp wants to merge 2 commits into
mainfrom
bm/h-6498-increase-line-width-to-100-across-the-js-libraries

Conversation

@indietyp
Copy link
Copy Markdown
Member

🌟 What is the purpose of this PR?

Increase the printWidth to 100, touches a lot of files because it needs to.

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:

  • do not affect the execution graph

@cursor
Copy link
Copy Markdown

cursor Bot commented May 23, 2026

PR Summary

Low Risk
Formatting-only changes (line wrapping/indentation/import grouping) across TypeScript, JSON, and Markdown with no intended runtime behavior changes; risk is limited to potential accidental whitespace-sensitive edits.

Overview
Updates formatting across the repo to reflect a wider printWidth (100), reflowing many TypeScript/JSON/Markdown files (e.g., collapsing multi-line arrays/objects/imports and tightening wrapped expressions).

No functional logic or API behavior is intentionally changed; diffs are overwhelmingly whitespace/line-break adjustments to match the new formatter output.

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

Copy link
Copy Markdown
Member Author

indietyp commented May 23, 2026

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 23, 2026

Codecov Report

❌ Patch coverage is 1.74359% with 958 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.73%. Comparing base (b9ecc19) to head (5bf3cce).

Files with missing lines Patch % Lines
...grations/001-create-hash-system-types.migration.ts 0.00% 58 Missing ⚠️
...ations/003-create-linear-system-types.migration.ts 0.00% 51 Missing ⚠️
.../src/activities/infer-entities/propose-entities.ts 0.00% 40 Missing ⚠️
.../activities/shared/get-llm-response/llm-message.ts 0.00% 32 Missing ⚠️
...es/research-entities-action/link-follower-agent.ts 0.00% 25 Missing ⚠️
...ts/src/activities/shared/optimize-system-prompt.ts 0.00% 25 Missing ⚠️
...inating-agent/update-state-from-inferred-claims.ts 0.00% 24 Missing ⚠️
...ivities/flow-activities/persist-entities-action.ts 0.00% 20 Missing ⚠️
...research-entities-action/sub-coordinating-agent.ts 0.00% 20 Missing ⚠️
.../shared/get-llm-response/get-anthropic-response.ts 0.00% 19 Missing ⚠️
... and 127 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8745      +/-   ##
==========================================
- Coverage   58.82%   58.73%   -0.10%     
==========================================
  Files        1328     1328              
  Lines      126882   126992     +110     
  Branches     5790     5809      +19     
==========================================
- Hits        74644    74583      -61     
- Misses      51357    51528     +171     
  Partials      881      881              
Flag Coverage Δ
apps.hash-ai-worker-ts 1.41% <2.38%> (+<0.01%) ⬆️
apps.hash-api 0.00% <0.00%> (ø)
blockprotocol.type-system 41.23% <ø> (+0.38%) ⬆️
local.claude-hooks 0.00% <0.00%> (ø)
local.harpc-client 51.22% <ø> (-0.02%) ⬇️
local.hash-backend-utils 2.74% <ø> (-0.07%) ⬇️
local.hash-graph-sdk 9.85% <ø> (+0.22%) ⬆️
local.hash-isomorphic-utils 0.00% <ø> (ø)
rust.antsi 0.00% <ø> (ø)
rust.error-stack 90.87% <ø> (ø)
rust.harpc-codec 84.70% <ø> (ø)
rust.harpc-net 96.18% <ø> (-0.05%) ⬇️
rust.harpc-tower 67.03% <ø> (ø)
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.81% <ø> (ø)
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-core 79.25% <ø> (ø)
rust.hashql-diagnostics 72.53% <ø> (ø)
rust.hashql-eval 77.88% <ø> (ø)
rust.hashql-hir 89.06% <ø> (ø)
rust.hashql-mir 86.76% <ø> (ø)
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.

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 23, 2026

🤖 Augment PR Summary

Summary: This PR increases the configured oxfmt line length to reduce wrapping and reflows the codebase accordingly.

Changes:

  • Updates oxfmt.config.ts to set printWidth from 80 → 100.
  • Reformats a large number of JS/TS/JSON/MD/etc files to match the new 100-column width (primarily line-joining/line-breaking changes).
  • Applies consistent formatting to long generic types, parameter lists, imports, and object/array literals as produced by oxfmt.

Technical Notes: The diff appears to be formatter-only (no functional changes intended); the main behavioral change is the formatter configuration update, which will affect pre-commit/CI formatting checks that run oxfmt.

🤖 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. No suggestions at this time.

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

@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

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

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment May 23, 2026 10:56am
hashdotdesign-tokens Ready Ready Preview, Comment May 23, 2026 10:56am
petrinaut Building Building Preview May 23, 2026 10:56am

.send(
`No data sent with ${payload.action} ${payload.type} webhook payload`,
);
res.status(400).send(`No data sent with ${payload.action} ${payload.type} webhook payload`);
res
.status(400)
.send(`No ID found in ${payload.action} ${payload.type} webhook payload`);
res.status(400).send(`No ID found in ${payload.action} ${payload.type} webhook payload`);
"state",
`"use strict"; var ${SHADOWED_GLOBALS}; ${code}`,
) as (state: MetricState) => unknown;
rawFn = new Function("state", `"use strict"; var ${SHADOWED_GLOBALS}; ${code}`) as (
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 23, 2026

Merging this PR will not alter performance

✅ 80 untouched benchmarks


Comparing bm/h-6498-increase-line-width-to-100-across-the-js-libraries (5bf3cce) with main (b9ecc19)

Open in CodSpeed

const constructorPattern = new RegExp(
`export\\s+default\\s+${constructorFnName}\\s*\\(`,
);
const constructorPattern = new RegExp(`export\\s+default\\s+${constructorFnName}\\s*\\(`);
@@ -6,8 +6,7 @@
* The base URL of the User entity type, used to detect user entities
* when enforcing property update restrictions.
*/
export const userEntityTypeBaseUrl =
"https://hash.ai/@h/types/entity-type/user/" as BaseUrl;
export const userEntityTypeBaseUrl = "https://hash.ai/@h/types/entity-type/user/" as BaseUrl;
const constructorPattern = new RegExp(
`export\\s+default\\s+${constructorFnName}\\s*\\(`,
);
const constructorPattern = new RegExp(`export\\s+default\\s+${constructorFnName}\\s*\\(`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semgrep identified an issue in your code:

User-controlled function name is used to construct a RegExp pattern without sanitization, allowing ReDoS attacks that can freeze the application's main thread.

More details about this

The constructorPattern RegExp is built from constructorFnName, a user-provided function argument. An attacker could pass a maliciously crafted constructorFnName containing regex metacharacters or patterns that cause catastrophic backtracking when the pattern is tested against sanitizedCode.

Exploit scenario:

  1. An attacker calls compileUserCode(code, "a+a+a+a+b") with a pathological regex pattern as the constructor name
  2. When constructorPattern.test(sanitizedCode) is called, the RegExp engine enters catastrophic backtracking trying to match the malicious pattern against even moderately-sized code strings
  3. The main thread blocks indefinitely, causing a Denial-of-Service and preventing the application from handling other requests

For example, with constructorFnName = "(a|a)*b" and a code string without that pattern, the regex engine will try exponentially many combinations before failing, freezing the application.

Dataflow graph
flowchart LR
    classDef invis fill:white, stroke: none
    classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none

    subgraph File0["<b>libs/@hashintel/petrinaut-core/src/simulation/authoring/user-code/compile-user-code.ts</b>"]
        direction LR
        %% Source

        subgraph Source
            direction LR

            v0["<a href=https://github.com/hashintel/hash/blob/5bf3cceaa4c0073a1b1a4259a02ccd867933fff5/libs/@hashintel/petrinaut-core/src/simulation/authoring/user-code/compile-user-code.ts#L44 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 44] constructorFnName</a>"]
        end
        %% Intermediate

        subgraph Traces0[Traces]
            direction TB

            v2["<a href=https://github.com/hashintel/hash/blob/5bf3cceaa4c0073a1b1a4259a02ccd867933fff5/libs/@hashintel/petrinaut-core/src/simulation/authoring/user-code/compile-user-code.ts#L44 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 44] constructorFnName</a>"]

            v3["<a href=https://github.com/hashintel/hash/blob/5bf3cceaa4c0073a1b1a4259a02ccd867933fff5/libs/@hashintel/petrinaut-core/src/simulation/authoring/user-code/compile-user-code.ts#L58 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 58] `</a>"]
        end
            v2 --> v3
        %% Sink

        subgraph Sink
            direction LR

            v1["<a href=https://github.com/hashintel/hash/blob/5bf3cceaa4c0073a1b1a4259a02ccd867933fff5/libs/@hashintel/petrinaut-core/src/simulation/authoring/user-code/compile-user-code.ts#L58 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 58] new RegExp(`export\\s+default\\s+${constructorFnName}\\s*\\(`)</a>"]
        end
    end
    %% Class Assignment
    Source:::invis
    Sink:::invis

    Traces0:::invis
    File0:::invis

    %% Connections

    Source --> Traces0
    Traces0 --> Sink


Loading

To resolve this comment:

✨ Commit fix suggestion

Suggested change
const constructorPattern = new RegExp(`export\\s+default\\s+${constructorFnName}\\s*\\(`);
export function compileUserCode<T extends unknown[] = unknown[]>(
code: string,
constructorFnName: string,
): (...args: T) => unknown {
// Validate the constructor function name before using it in generated code.
// This ensures it is a safe JavaScript identifier and avoids dynamic regex usage.
const safeIdentifierRegex = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
if (!safeIdentifierRegex.test(constructorFnName)) {
throw new Error(
`Invalid constructor function name '${constructorFnName}'. Expected a valid JavaScript identifier.`,
);
}
const validatedConstructorFnName = constructorFnName;
// Strip TypeScript type annotations and remove leading/trailing whitespace
const sanitizedCode = stripTypeAnnotations(code.trim());
// Verify that the code has a default export
const defaultExportRegex = /export\s+default\s+/;
if (!defaultExportRegex.test(sanitizedCode)) {
throw new Error(
`Module must have a default export. Expected pattern: export default ${validatedConstructorFnName}(...)`,
);
}
// Verify that the default export uses the specified constructor function
const expectedExport = `export default ${validatedConstructorFnName}`;
const exportIndex = sanitizedCode.indexOf(expectedExport);
let hasExpectedConstructorCall = false;
if (exportIndex !== -1) {
let nextIndex = exportIndex + expectedExport.length;
while (
nextIndex < sanitizedCode.length &&
/\s/.test(sanitizedCode[nextIndex])
) {
nextIndex += 1;
}
hasExpectedConstructorCall = sanitizedCode[nextIndex] === "(";
}
if (!hasExpectedConstructorCall) {
throw new Error(
`Default export must use the constructor function '${validatedConstructorFnName}'. Expected pattern: export default ${validatedConstructorFnName}(...)`,
);
}
try {
// Create a mock constructor function that extracts the wrapped function
const mockConstructor = `
function ${validatedConstructorFnName}(fn) {
if (typeof fn !== 'function') {
throw new Error('${validatedConstructorFnName} expects a function as argument');
}
return fn;
}
`;
// Create an executable module-like environment
const executableCode = `
${distributionRuntimeCode}
${mockConstructor}
let __default_export__;
${sanitizedCode.replace(/export\s+default\s+/, "__default_export__ = ")}
return __default_export__;
`;
// Use Function constructor to create and execute the module
// eslint-disable-next-line no-new-func, @typescript-eslint/no-implied-eval, @typescript-eslint/no-unsafe-call
const compiledFunction = new Function(executableCode)() as (
...args: T
View step-by-step instructions
  1. Remove the dynamic RegExp constructor that uses constructorFnName.
  2. Build the expected export prefix as a plain string, for example const expectedExport = \export default ${constructorFnName}`;`.
  3. Check for the constructor call with string operations instead of regex, such as finding expectedExport in sanitizedCode and then verifying the next non-space character after the constructor name is (.
  4. Keep the existing static regex for the generic export default check, because /export\s+default\s+/ is hardcoded and does not use tainted input.
  5. Validate constructorFnName before using it elsewhere in generated code so it only contains a safe JavaScript identifier, for example by checking it against a hardcoded regex like /^[A-Za-z_$][A-Za-z0-9_$]*$/. This prevents malformed names from breaking the parser and avoids needing dynamic regex escaping.
  6. Update the error path to use the same validated constructorFnName value when reporting the expected pattern.

Alternatively, if you need to preserve flexible whitespace matching, split the logic into simple string parsing steps instead of new RegExp(...), for example by locating export default, trimming the following text, and comparing the next token to constructorFnName.

💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by detect-non-literal-regexp.

You can view more details about this finding in the Semgrep AppSec Platform.

@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 $$27.3 \mathrm{ms} \pm 211 \mathrm{μs}\left({\color{gray}-1.742 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.36 \mathrm{ms} \pm 17.5 \mathrm{μs}\left({\color{gray}-2.331 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1001 $$12.3 \mathrm{ms} \pm 92.0 \mathrm{μs}\left({\color{gray}-3.069 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$42.8 \mathrm{ms} \pm 345 \mathrm{μs}\left({\color{gray}-2.217 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$14.0 \mathrm{ms} \pm 94.1 \mathrm{μs}\left({\color{gray}-1.460 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1526 $$23.8 \mathrm{ms} \pm 154 \mathrm{μs}\left({\color{gray}-3.096 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$28.4 \mathrm{ms} \pm 205 \mathrm{μs}\left({\color{gray}-0.225 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.66 \mathrm{ms} \pm 17.1 \mathrm{μs}\left({\color{gray}-1.972 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$13.4 \mathrm{ms} \pm 101 \mathrm{μs}\left({\color{gray}-4.371 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.84 \mathrm{ms} \pm 27.2 \mathrm{μs}\left({\color{gray}0.746 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.98 \mathrm{ms} \pm 15.1 \mathrm{μs}\left({\color{gray}0.919 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 51 $$3.33 \mathrm{ms} \pm 12.9 \mathrm{μs}\left({\color{gray}0.655 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.17 \mathrm{ms} \pm 25.4 \mathrm{μs}\left({\color{gray}-0.254 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.52 \mathrm{ms} \pm 16.9 \mathrm{μs}\left({\color{gray}0.036 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 107 $$4.14 \mathrm{ms} \pm 20.7 \mathrm{μs}\left({\color{gray}-0.014 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.46 \mathrm{ms} \pm 24.1 \mathrm{μs}\left({\color{gray}0.156 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.41 \mathrm{ms} \pm 18.1 \mathrm{μs}\left({\color{gray}0.971 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.19 \mathrm{ms} \pm 22.4 \mathrm{μs}\left({\color{gray}2.86 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.69 \mathrm{ms} \pm 12.4 \mathrm{μs}\left({\color{gray}-2.235 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.64 \mathrm{ms} \pm 13.7 \mathrm{μs}\left({\color{gray}-1.008 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1 $$2.79 \mathrm{ms} \pm 17.1 \mathrm{μs}\left({\color{gray}0.792 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$3.05 \mathrm{ms} \pm 14.7 \mathrm{μs}\left({\color{gray}-2.005 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.81 \mathrm{ms} \pm 14.5 \mathrm{μs}\left({\color{gray}-3.772 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$3.12 \mathrm{ms} \pm 16.0 \mathrm{μs}\left({\color{gray}-1.487 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.09 \mathrm{ms} \pm 13.8 \mathrm{μs}\left({\color{gray}0.377 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.79 \mathrm{ms} \pm 14.9 \mathrm{μs}\left({\color{gray}0.142 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 25 $$2.95 \mathrm{ms} \pm 11.0 \mathrm{μs}\left({\color{gray}-0.163 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.54 \mathrm{ms} \pm 17.5 \mathrm{μs}\left({\color{gray}1.31 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.05 \mathrm{ms} \pm 12.5 \mathrm{μs}\left({\color{gray}0.943 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 26 $$3.34 \mathrm{ms} \pm 19.0 \mathrm{μs}\left({\color{gray}2.40 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.42 \mathrm{ms} \pm 14.1 \mathrm{μs}\left({\color{gray}-0.792 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.06 \mathrm{ms} \pm 16.8 \mathrm{μs}\left({\color{gray}1.28 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.39 \mathrm{ms} \pm 19.4 \mathrm{μs}\left({\color{gray}0.148 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$44.6 \mathrm{ms} \pm 153 \mathrm{μs}\left({\color{gray}-0.793 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$82.2 \mathrm{ms} \pm 301 \mathrm{μs}\left({\color{gray}-0.887 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$48.9 \mathrm{ms} \pm 200 \mathrm{μs}\left({\color{gray}-1.813 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$53.1 \mathrm{ms} \pm 406 \mathrm{μs}\left({\color{gray}2.53 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$62.4 \mathrm{ms} \pm 355 \mathrm{μs}\left({\color{gray}2.17 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$47.4 \mathrm{ms} \pm 188 \mathrm{μs}\left({\color{gray}2.06 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$425 \mathrm{ms} \pm 972 \mathrm{μs}\left({\color{gray}-2.537 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$102 \mathrm{ms} \pm 447 \mathrm{μs}\left({\color{gray}-2.117 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$91.4 \mathrm{ms} \pm 349 \mathrm{μs}\left({\color{gray}-1.792 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$292 \mathrm{ms} \pm 966 \mathrm{μs}\left({\color{gray}0.245 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$19.6 \mathrm{ms} \pm 98.0 \mathrm{μs}\left({\color{gray}1.10 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$20.0 \mathrm{ms} \pm 111 \mathrm{μs}\left({\color{gray}0.675 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$20.1 \mathrm{ms} \pm 125 \mathrm{μs}\left({\color{gray}-0.049 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$19.7 \mathrm{ms} \pm 115 \mathrm{μs}\left({\color{gray}-1.905 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$24.7 \mathrm{ms} \pm 146 \mathrm{μs}\left({\color{red}5.54 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$19.5 \mathrm{ms} \pm 98.6 \mathrm{μs}\left({\color{gray}2.06 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$19.5 \mathrm{ms} \pm 95.5 \mathrm{μs}\left({\color{gray}1.52 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$19.4 \mathrm{ms} \pm 95.7 \mathrm{μs}\left({\color{gray}0.312 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$19.8 \mathrm{ms} \pm 117 \mathrm{μs}\left({\color{gray}-0.548 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$26.1 \mathrm{ms} \pm 226 \mathrm{μs}\left({\color{gray}-1.971 \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.5 \mathrm{ms} \pm 335 \mathrm{μs}\left({\color{gray}-3.616 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$33.9 \mathrm{ms} \pm 275 \mathrm{μs}\left({\color{gray}-1.258 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$33.1 \mathrm{ms} \pm 309 \mathrm{μs}\left({\color{gray}-4.259 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$34.6 \mathrm{ms} \pm 328 \mathrm{μs}\left({\color{gray}1.16 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$34.3 \mathrm{ms} \pm 360 \mathrm{μs}\left({\color{gray}-1.264 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$34.5 \mathrm{ms} \pm 280 \mathrm{μs}\left({\color{gray}-1.841 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$34.3 \mathrm{ms} \pm 355 \mathrm{μs}\left({\color{gray}-3.322 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$33.8 \mathrm{ms} \pm 236 \mathrm{μs}\left({\color{gray}-4.951 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$33.3 \mathrm{ms} \pm 307 \mathrm{μs}\left({\color{gray}-4.195 \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 51.2 \mathrm{μs}\left({\color{gray}-0.240 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$92.8 \mathrm{ms} \pm 502 \mathrm{μs}\left({\color{gray}0.357 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$144 \mathrm{ms} \pm 553 \mathrm{μs}\left({\color{gray}-1.831 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$99.8 \mathrm{ms} \pm 509 \mathrm{μs}\left({\color{gray}-0.089 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$108 \mathrm{ms} \pm 544 \mathrm{μs}\left({\color{gray}0.642 \mathrm{\%}}\right) $$
entity_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 521 \mathrm{μs}\left({\color{gray}0.383 \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 646 \mathrm{μs}\left({\color{gray}-0.876 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$101 \mathrm{ms} \pm 506 \mathrm{μs}\left({\color{gray}-0.247 \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 $$129 \mathrm{ms} \pm 512 \mathrm{μs}\left({\color{gray}-0.887 \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 $$108 \mathrm{ms} \pm 552 \mathrm{μs}\left({\color{gray}0.017 \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 $$116 \mathrm{ms} \pm 537 \mathrm{μs}\left({\color{gray}-0.833 \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 $$119 \mathrm{ms} \pm 585 \mathrm{μs}\left({\color{gray}-0.007 \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 558 \mathrm{μs}\left({\color{gray}-1.757 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$143 \mathrm{ms} \pm 530 \mathrm{μs}\left({\color{red}6.29 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$154 \mathrm{ms} \pm 561 \mathrm{μs}\left({\color{red}6.99 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$61.9 \mathrm{ms} \pm 3.19 \mathrm{ms}\left({\color{lightgreen}-41.073 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$536 \mathrm{ms} \pm 1.15 \mathrm{ms}\left({\color{gray}-4.783 \mathrm{\%}}\right) $$ Flame Graph

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants