Skip to content

Improve metadb approve performance#9575

Merged
michaelstaib merged 6 commits intomainfrom
mst/optimized-metadb
Apr 19, 2026
Merged

Improve metadb approve performance#9575
michaelstaib merged 6 commits intomainfrom
mst/optimized-metadb

Conversation

@michaelstaib
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 17, 2026 15:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 optimizes CompositeResultDocument’s metadata database (MetaDb) writes by introducing specialized append paths and a revised packed row layout to reduce per-row overhead during document construction.

Changes:

  • Added specialized MetaDb append methods (AppendNull, AppendEmptyProperty, AppendEmptyPropertyWithNullValue) and refactored generic Append to use a shared ReserveRow helper.
  • Reworked DbRow packing/layout and updated MetaDb fast-read accessors to match the new structure.
  • Expanded MetaDb tests to cover number-of-rows storage and the new specialized append behaviors, including chunk-boundary cases.

Reviewed changes

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

File Description
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Text/Json/CompositeResultDocumentMetaDbTests.cs Adds test coverage for new MetaDb specialized append methods and updated field storage.
src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/CompositeResultDocument.cs Switches empty-property/value emission to the new specialized MetaDb append methods.
src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/CompositeResultDocument.MetaDb.cs Implements specialized append fast paths, shared row reservation, and updated read/write offsets for the new row layout.
src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/CompositeResultDocument.DbRow.cs Changes the packed row layout and exposes byte offsets for MetaDb’s direct-read paths.

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

@michaelstaib michaelstaib force-pushed the mst/optimized-metadb branch from ecc8105 to dcda442 Compare April 19, 2026 08:05
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