Skip to content

Improve MetaDb table pooling - #10091

Merged
michaelstaib merged 3 commits into
mainfrom
mst/metadb-pooling
Jul 11, 2026
Merged

michaelstaib merged 3 commits into
mainfrom
mst/metadb-pooling

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 11, 2026 18:15

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 improves MemorySegmentTablePool behavior for segment-table sizes that exceed the bucketed range by introducing a private fallback ArrayPool<MemorySegment>, enabling deterministic reuse of cleared tables and allowing downstream callers (MetaDb creation) to remove redundant clearing.

Changes:

  • Introduces a private fallback pool for MemorySegment[] tables larger than the bucketed range, and routes rent/return through it.
  • Updates tests to validate clearing behavior for the fallback path.
  • Updates MemoryArena XML docs and removes now-redundant chunks.AsSpan().Clear() calls in Fusion MetaDb initialization.

Reviewed changes

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

Show a summary per file
File Description
src/HotChocolate/Utilities/test/Utilities.Tests/MemorySegmentTablePoolTests.cs Updates/extends pooling tests to cover fallback-table reuse + clearing semantics.
src/HotChocolate/Utilities/src/Utilities.Buffers/MemorySegmentTablePool.cs Adds a private fallback ArrayPool and updates rent/return logic for out-of-range table sizes.
src/HotChocolate/Utilities/src/Utilities.Buffers/MemoryArena.cs Updates RentSegmentTable documentation to reflect the cleared-table contract.
src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/SourceResultDocument.MetaDb.cs Removes redundant clearing of chunk-slot tables now that they’re guaranteed cleared.
src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/CompositeResultDocument.MetaDb.cs Removes redundant clearing of chunk-slot tables now that they’re guaranteed cleared.

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

@github-actions

github-actions Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Patch coverage

100.0% of changed lines covered (8/8)

File Covered Changed Patch %
…/Utilities/src/Utilities.Buffers/MemorySegmentTablePool.cs 8 8 100.0% 🟢

Project coverage: 53.4% (227648/426407 lines)

michaelstaib and others added 2 commits July 11, 2026 20:42
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@michaelstaib
michaelstaib merged commit 9370335 into main Jul 11, 2026
7 of 8 checks passed
@michaelstaib
michaelstaib deleted the mst/metadb-pooling branch July 11, 2026 18:43
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