Remove unused sizeInfo and other performance tweaks#1745
Merged
Conversation
…elector, and SessionFunctionsWrapper. Make some changes to reduce "if"s and field accesses
badrishc
reviewed
Apr 28, 2026
badrishc
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove unused sizeInfo from InternalRMW, InternalUpsert, UpsertValueSelector, and SessionFunctionsWrapper.
Make some changes to reduce "if"s and field accesses.
This pull request introduces several improvements and refactorings focused on safety, performance, and maintainability in the string operations and storage engine layers. The main themes are: improved type safety and fast paths for string operations, API simplification in session functions, and more accurate heap memory tracking for in-place updates.
String Operations and Type Safety:
RMWMethods.cs: now, type checks are skipped for normal string records (RecordType 0), and only the relevant checks are performed for RangeIndex and non-RangeIndex keys. This prevents unnecessary checks and improves safety for mixed key types. [1] [2]ReadMethods.cs, bypassing unnecessary checks for the most common case, which improves read performance.Session Functions API Simplification:
ISessionFunctionsWrapperand related wrappers to remove the unusedRecordSizeInfoparameter from in-place writer/updater methods, simplifying the API and reducing overhead. [1] [2] [3] [4] [5] [6]Performance and Memory Tracking:
InternalRMW.csby using alogSizeTrackerto accurately measure and update heap usage before and after in-place updates, including special handling for expired or deleted objects. [1] [2]Code Quality and Maintainability:
[MethodImpl(MethodImplOptions.AggressiveInlining)]to several frequently called methods to encourage inlining and improve performance. [1] [2] [3] [4]Other:
RawStringOperations.cs.RMWMethods.cs.