Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Apr 8, 2025

Based on a perf review togehter with nielsdos (php-src core develoepr) we identified array_map, when used with a callback function to be a hotspot in PHPStan analysis, see https://phpc.social/@markusstaab/114301182551454759

I've did some research and used some hack to record the call count of array_map when running PHPStan and isolate the following list of call sites from BetterReflection.

the list contains 3 outstanding callers which dominate the call-counts. these occurences have been adjusted with this PR.

⚠️ still work in progress

@ondrejmirtes
Copy link
Contributor

Please note that I'm skeptical about this: phpstan/phpstan-src#3926 (comment)

@Ocramius
Copy link
Member

Ocramius commented Apr 8, 2025

I'm also not really looking forward to maintaining more loops: would rather endorse pushing the concern to php-src, at the cost of performance overhead here, for now.

@staabm
Copy link
Contributor Author

staabm commented Apr 14, 2025

@staabm staabm closed this Apr 14, 2025
@staabm staabm deleted the inline-map branch April 14, 2025 18:28
@Ocramius
Copy link
Member

Nice!

@staabm
Copy link
Contributor Author

staabm commented Apr 18, 2025

php 8.5.x is running ~10% faster thanks to recent fixes.

see php/php-src#18273 (comment)

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.

4 participants