Ensure all structs that implement an interface used as a type constraint implement all methods - #2013
Open
TedHartMS wants to merge 3 commits into
Open
Ensure all structs that implement an interface used as a type constraint implement all methods#2013TedHartMS wants to merge 3 commits into
TedHartMS wants to merge 3 commits into
Conversation
…ctions fully implement all interfaces that that form those type constraints
TedHartMS
requested review from
badrishc and
Copilot
and removed request for
Copilot
August 3, 2026 18:03
badrishc
approved these changes
Aug 3, 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.
This pull request extends the fix in PR #1988 to eliminate unnecessary boxing by explicitly implementing interface members—particularly default interface methods (DIMs)—in key structs and record trigger implementations. By directly implementing these members, calls through generic constraints will resolve to the struct's own methods, improving performance and avoiding the overhead of boxing. Additionally, all key structs now explicitly implement the
IsEmptyproperty.The most important changes are:
Performance improvements through explicit interface implementations:
Explicitly implemented default interface methods (DIMs) for
IRecordTriggersand related interfaces in various structs (e.g.,OnDispose,OnFlush,OnEvict,OnDiskRead,OnRecovery,OnCheckpoint,PostCopyToTail,OnTruncate) to ensure generic constraint calls resolve without boxing, both in production and test code. [1] [2] [3] [4] [5] [6] [7]Implemented
PhysicalAddressexplicitly inLogRecordandDiskLogRecordto avoid boxing when accessed throughISourceLogRecord. [1] [2]Key interface consistency:
IsEmptyproperty (always returningfalse) to allIKeystructs in both production and test code, ensuring interface contract consistency and avoiding default interface dispatch. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Code clarity and documentation:
These changes collectively improve runtime efficiency and code clarity by ensuring interface methods are resolved to struct implementations without incurring boxing costs.