Skip to content

Conversation

@BorisDog
Copy link
Contributor

@BorisDog BorisDog commented Dec 3, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 3, 2025 23:30
@BorisDog BorisDog requested a review from a team as a code owner December 3, 2025 23:30
@BorisDog BorisDog requested a review from ajcvickers December 3, 2025 23:30
@BorisDog BorisDog added the improvement Optimizations or refactoring (no new features or fixes). label Dec 3, 2025
Copy link
Member

@sanych-sun sanych-sun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
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 the BsonClassMapSerializer by converting two foreach loops to for loops with indexed access, reducing memory allocations from enumerator objects. The change targets hot paths in the serialization framework where member maps are iterated frequently.

Key Changes

  • Replaced foreach loop with indexed for loop in TryGetMemberSerializationInfo method
  • Replaced foreach loop with indexed for loop in SerializeClass method

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

@BorisDog BorisDog merged commit e3b25ba into mongodb:main Dec 4, 2025
40 of 43 checks passed
@BorisDog BorisDog deleted the csharp5667 branch December 4, 2025 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Optimizations or refactoring (no new features or fixes).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants