Repository navigation
[perf] Add single-process hotspot profiler + performance methodology - #8718
Merged
Merged
Conversation
Member
Author
|
LGMT 👍 |
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.
What
Adds the tooling and written method behind the recent batch of measured perf PRs (#8705-#8714), so the next perf pass starts from data, not guesses.
scripts/rector-hotspot-profile.phpStandalone single-process hotspot profiler. Runs
rector process --dry-runover a real project under the Xdebug profiler with parallel disabled (parallel workers each write their own cachegrind and make the numbers useless), parses the cachegrind, and ranks functions two ways:php scripts/rector-hotspot-profile.php --project=/path/to/a/real/app --filter='^(Rector|PHPStan)'Standalone: drives the binary as a subprocess, no autoloader of its own. Docblock documents the two traps found while building it - small corpora are dominated by container bootstrap, and most type/scope cost lives in
PHPStan\*notRector\*.CLAUDE.md- Performance work sectionShort methodology: profile a single-process real run to find the hot spot, qualify a cache candidate by confirming inputs actually repeat and picking a version-safe key (AST mutates to a fixpoint, so node-identity/file-path keys go stale), prove it with CPU-time and call-count A/B rather than wall time, and gate on the full suite plus the order-dependent fixpoint tests.
Why
Keeps the measurement discipline from the perf batch reproducible instead of tribal knowledge.