Remove unnecessary use of NoInlining and add traceability for valid uses, #931 #1134
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 unnecessary use of NoInlining and add traceability for valid uses
Fixes #931
Description
This removes over 100 uses of NoInlining that did not trace back to actual usage in tests that inspect the stack trace, which unnecessarily harm performance. To determine this, debugging and code review was used to find which methods were actually being expected in the stack trace. Once the expected method was determined, the string literal of the method name was replaced with the
nameof
operator for go-to-definition traceability back to the method (or multiple overloads, in some cases) in question. Likewise, a comment was added on the use of NoInlining on the method to explain which test(s) needed this attribute. This way we have two-way traceability to help prevent accidental removal in the future. This could be improved with a custom dev analyzer and suppression in the near future.One case remains, in PreFlexRWTermVectorsFormat, where I could not hit a breakpoint in tests that use this type, so I am not sure that it is actually needed. This was left as-is with a LUCENENET TODO comment. I presume it is likely expecting
SegmentMerger.Merge
like the similar PreFlexRWPostingsFormat, but I couldn't determine this for sure.This PR is currently in draft status to ensure all tests pass. I'll publish it once I get extra validation that the removals are correct through multiple test runs.