Repository navigation
Measure disabled tach recording after a warm-up pass - #197
Merged
Merged
Conversation
DisabledRecordCallsCreateNoHistoryOrPerCallAllocations measured the first run of a loop in the test method. That run includes the loop's on-stack replacement compile, which happens on the test thread near the 10,000th iteration. Runtime work during that compile can allocate on the test thread: in local runs that force the compile into the window, the runtime added a 16,344-byte object to the pinned object heap, and the test failed although the disabled record calls allocate nothing. Whether this happens depends on process state from earlier work, so the isolated nightly run failed intermittently (49,200 bytes on 2026-10-27). Run the same loop once before measuring, and read the elapsed time after the allocation count, so the measured window contains only the record calls.
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.
Problem
TachDiagnosticsTests.DisabledRecordCallsCreateNoHistoryOrPerCallAllocationsmeasured the first run of a loop in the test method. That run includes the loop's on-stack-replacement compile, which happens on the test thread near the 10,000th iteration, and runtime work during that compile can allocate on the test thread (locally a 16,344-byte object on the pinned object heap; 49,200 bytes in the isolated nightly run of 2026-10-27). The test then failed although the disabled record calls allocate nothing, and whether it happens depends on process state from earlier work.Change
Run the same loop once before measuring, and read the elapsed time after the allocation count, so the measured window contains only the record calls (
tests/Wisp.App.Tests/TachDiagnosticsTests.cs). Test-only; no product code changes.Verification
CI runs the test in the full suite; the nightly runs it isolated.
Closes #195