Skip to content

Micro optimize LazyInternalScopeFactory #3962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 26, 2025
Merged

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Apr 23, 2025

getParameter() is showing up in perf profiles

grafik

before this PR

➜  phpstan-src git:(2.1.x) hyperfine 'php bin/phpstan analyze src/Analyser/NodeScopeResolver.php --debug # Old' -i
Benchmark 1: php bin/phpstan analyze src/Analyser/NodeScopeResolver.php --debug # Old
  Time (mean ± σ):      7.266 s ±  0.020 s    [User: 7.079 s, System: 0.183 s]
  Range (min … max):    7.230 s …  7.292 s    10 runs

after this PR

➜  phpstan-src git:(2.1.x) ✗ hyperfine 'php bin/phpstan analyze src/Analyser/NodeScopeResolver.php --debug # New' -i
Benchmark 1: php bin/phpstan analyze src/Analyser/NodeScopeResolver.php --debug # New
  Time (mean ± σ):      7.124 s ±  0.018 s    [User: 6.935 s, System: 0.184 s]
  Range (min … max):    7.085 s …  7.156 s    10 runs

@ondrejmirtes ondrejmirtes merged commit d2b7e81 into phpstan:2.1.x Apr 26, 2025
417 checks passed
@ondrejmirtes
Copy link
Member

Thank you.

@staabm staabm deleted the lazier branch April 26, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants