Skip to content

[Fusion] Fix oversized path pool slot storage - #10557

Merged
tobias-tengler merged 3 commits into
mainfrom
perf/fusion-path-pool-slots-20261016
Oct 17, 2026
Merged

tobias-tengler merged 3 commits into
mainfrom
perf/fusion-path-pool-slots-20261016

Conversation

@tobias-tengler

@tobias-tengler tobias-tengler commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Fusion reserves a 13.6-million-entry reference table for its shared path-segment pool, allocating about 104 MiB even when only the initial 4,096 slots are needed.

This change allocates reference pages on demand, reducing initial allocation to about 58 KiB while preserving the batching and local reuse from #10548. Trim releases segment arrays and keeps the reference pages for reuse. After the tested 131,072-array peak, about 1 MiB of reference pages remains reserved.

Method Version Mean Ratio
Warm reuse, 1,024 arrays, 1 worker main 13.346 µs 1.00
Warm reuse, 1,024 arrays, 1 worker PR 11.771 µs 0.88
Warm reuse, 1,024 arrays, 16 workers main 13.969 µs 1.00
Warm reuse, 1,024 arrays, 16 workers PR 10.550 µs 0.76
Grow, return and trim, 131,072 arrays, 16 workers main 17.852 ms 1.00
Grow, return and trim, 131,072 arrays, 16 workers PR 16.991 ms 0.95

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Patch coverage

97.3% of changed lines covered (72/74)

File Covered Changed Patch %
…/Fusion/src/Fusion.Execution/Text/Json/PathSegmentPool.cs 72 74 97.3% 🟡
Uncovered changed lines (JSON)
{
  "sha": "4f395554c1e967e6b21885dfdfc4b5361195bdf8",
  "files": [
    { "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/PathSegmentPool.cs", "ranges": [[352, 352], [407, 407]] }
  ]
}

Project coverage: 59.0% (311476/527757 lines)

@tobias-tengler
tobias-tengler marked this pull request as ready for review October 17, 2026 21:01
Copilot AI balanced review requested due to automatic review settings October 17, 2026 21:01

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@tobias-tengler
tobias-tengler merged commit 1588858 into main Oct 17, 2026
155 checks passed
@tobias-tengler
tobias-tengler deleted the perf/fusion-path-pool-slots-20261016 branch October 17, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants