Repository navigation
Stop the simulation after the benchmark's span - #5
Merged
Merged
Conversation
Since the counter started the instrumentation once for the whole case, the after methods and the end of the process ran under Callgrind's cache simulation too, such as PHPStan freeing its container. The counter now stops the instrumentation after the last span, also when the benchmark throws. The counts stay the same; analysing bug-1388.php in PHPStan's benchmarks took 31 instead of 34 seconds. Amp-Thread-ID: https://ampcode.com/threads/T-01a1d73a-bab0-7223-9245-50c2c00f22c7
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.
Since #4, the counter starts Callgrind's instrumentation once per case. Until now it then stayed on through the
#[After]methods and the end of the process, such as PHPStan freeing its container, which all ran under the cache simulation. phpstan-src's slowest shard went from 17 to 23.5 minutes, part of which is a slower benchmark of its own.Counter::finish()is the counterpart ofprepare().CaseRunnercalls it after the benchmark's span, also when the benchmark throws, andCodSpeedCounterthen stops the instrumentation through the newTally\Hooks\stop_instrumentation()oftally_hooks1.2.0.The counts stay the same. Locally on PHP 8.5.12,
WarmupBenchgave the same instructions within a few under1.xand this branch, and so did phpstan-src'sbug-1388.php(593.25M). That case took 31 s instead of 34 s in total, including the native run.