-
Notifications
You must be signed in to change notification settings - Fork 2
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
Speed up #426
Comments
It would be ideal to have same dir for following runs for same project to make use of phpstan results cache. But we need to figure out how to prevent overwriting identical templates (so phostan would not thinknit changed) and how to clean up old templates. Maybe first compile to some tmp dir and then compare this tmp dir with analysed dir? |
Complete? Great :) I'm ready to sacrifice our internal compiled template cache mechanism for the sake of speed up. I'm cleaning the phpstan latte dir before almost each run anyway |
Question is: “what is slowest part of this extension?”
|
Sorry I put unlocked phone to my pocket 😀 My main candidate is latte context collection for template resolvers. But it is also hardest thing to speed up significantly. |
I did some simple measurements: Sometimes analysing files is the slowest, sometimes adjusting templates is the slowest. I'm not sure if it depends on size of template or something else. We can look at node visitors, but there is not much things to approve if we want to have testable compiled templates, but we can try to run phpstan via "exec"-like command. We will see |
Idea for adjusting templates: Maybe visitors can specify some fast checks (like template/comoiled template contains given string/regex) and run only if it is true. For example it does not make sense to run forms related visitors for templates without any form/input tags. |
I like the idea for fast checks, just don't like the implementation with regexes, but maybe it is best thing we can do :) |
I've achieved 12% speed up on my test app with running phpstan on compiled templates via shell_exec. I have to admit it is lower then my expectations :D Tomorrow I'll push it and you can try it too. |
The text was updated successfully, but these errors were encountered: