Skip to content

Reduce schema compilation memory for large documents - #170

Merged
rasuvaeff merged 1 commit into
masterfrom
perf/165-avoid-resolver-rewalks
Oct 8, 2026
Merged

rasuvaeff merged 1 commit into
masterfrom
perf/165-avoid-resolver-rewalks

Conversation

@rasuvaeff

@rasuvaeff rasuvaeff commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Partially addresses #165

Stripe's spec3.json exhausted a 10 GiB PHP limit while compiling response schemas. Profiling showed monotonic growth from Opis schema graphs retained for every compiled root; effectiveSchema() itself was not the dominant allocation site.

This change:

  • avoids re-resolving Path Item parameters, request bodies, and responses;
  • interns identical reference-free schema nodes across compiled roots;
  • adds regression coverage for resolver budgets and schema graph sharing.

Validation:

  • make build (946 tests, 4552 assertions)
  • make rector
  • git diff --check
  • Stripe profile: 612 operations, about 109 s, 5.87 GiB peak with a 10 GiB PHP limit

This improves peak memory, but does not yet meet the issue's single-digit-second target. Issue #165 remains open for that work.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7fb2b01e-bacf-44f5-bd36-98d9b617a12b
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@rasuvaeff
rasuvaeff force-pushed the perf/165-avoid-resolver-rewalks branch 2 times, most recently from 32c5084 to ae7d3e4 Compare October 7, 2026 21:34
@rasuvaeff
rasuvaeff force-pushed the perf/165-avoid-resolver-rewalks branch from ae7d3e4 to ddc224b Compare October 7, 2026 21:56
@rasuvaeff
rasuvaeff merged commit f93af77 into master Oct 8, 2026
10 checks passed
@rasuvaeff
rasuvaeff deleted the perf/165-avoid-resolver-rewalks branch October 8, 2026 07:20
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