Skip to content

perf(v2): reduce resolver allocations - #930

Merged
harlan-zw merged 2 commits into
v2from
perf/v2-ssr-structural-sharing
Aug 4, 2026
Merged

perf(v2): reduce resolver allocations#930
harlan-zw merged 2 commits into
v2from
perf/v2-ssr-structural-sharing

Conversation

@harlan-zw

@harlan-zw harlan-zw commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Backports #812.

  • reuse static arrays and objects while walking resolver input
  • shallow copy only after a resolver or function changes a branch
  • preserve isolated copies for v2's mutable Schema.org resolver markers
  • drop unsafe prototype keys from copied results
  • keep the shared prototype key guard internal

The upstream benchmark measured roughly 18% lower SSR allocation in this path. No exports, options, or public types are added.

Validation

  • workspace suite: 707 passed, 2 skipped
  • Unhead suite: 427 passed, 2 skipped
  • Schema.org duplicate action regression: 9 passed
  • scoped ESLint
  • pnpm typecheck
  • pnpm build

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 832206b4-769f-4dff-a334-0bcde68a94fe

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@harlan-zw
harlan-zw merged commit bba1f3b into v2 Aug 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant