-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Performance problems with internal PHP sniffs #104
Comments
it could be normal for big files - I mean this is what I observed in the past - big file, many internal functions used.... Probably still it is possible to improve the code, so more data could be useful :) Thanks! |
I could provide more information. What do you need? |
@FabianKoestring Example file would be the best. If you can share a file for which the operation is very slow I would be able to xdebug it, check what part is actually slow and try to make it better. |
Hey @michalbundyra sry for my late reply. I dont want make my private code public so i searched for slow files in some of my vendors. It seems like https://github.com/doctrine/dbal/blob/2.10.x/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php is a relativly big and slow file. |
@FabianKoestring Sorry for late response... I had a quick look on it. I cannot see right now any simple fix to improve performance here, and as it is affecting just big files, I am not going to spend more time on it now. Probably from maintenance point of view it would be better to split big files into smaller, if possible. I am leaving this ticket as open and adding label "help wanted" as maybe someone will be able to investigate it more and provide some improvements. Thanks for reporting and providing example file. |
@michalbundyra I suspect you can solve most of the performance issues with some of the "trackers"/abstract sniffs I'm working on for PHPCSUtils. Hoping to include those in the 1.1.0 release, though there may already be some utilities available to help mitigate this a little already. |
Thanks, @jrfnl , I'll check it out! |
@michalbundyra FYI: Part of why the PHPCSUtils utilities are better for performance is that anything which does significant token walking uses an internal cache. This means that if multiple sniffs execute the same functions with the same |
Hey there,
on some files we have performance problems with both sniffs (
src/WebimpressCodingStandard/Sniffs/PHP/ImportInternalConstantSniff.php
andsrc/WebimpressCodingStandard/Sniffs/PHP/ImportInternalFunctionSniff.php
).Sometimes these sniffs will take up to 20 seconds.
Do you need more data or could this behavior be normal?
The text was updated successfully, but these errors were encountered: