-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Improved performance of LoggerDataCollector #29762
Conversation
Does this really work? |
It worked for me when I added this in the lageCollect() method: $this->data['compiler_logs_filepath'] = $this->containerPathPrefix.'Compiler.log'; Otherwise But of course it's not enough that this works for me. We need more people to confirm us that this is working for them too. Thanks! |
OK, got it! What this does is share the same log file for all profiles, instead of snapshotting them per profiler. Works for me! (but tests are failing ;) ) |
I've fixed tests ... but I'm not sure it's the right fix. |
src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php
Outdated
Show resolved
Hide resolved
8f7bea2
to
3b8d6d1
Compare
Thank you @javiereguiluz. |
This PR was squashed before being merged into the 4.3-dev branch (closes #29762). Discussion ---------- Improved performance of LoggerDataCollector | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | - <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | - My feeling is that Symfony's "dev" environment is more and more slow lately. After profiling the Symfony Demo app with Blackfire, I found that `getContainerCompilerLogs()` is one of the slowest methods. Given that you rarely need or look at these "compiler logs", in this PR I propose to get them only when/if you really need them. [The before/after profile comparison](https://blackfire.io/profiles/compare/4959d918-8e00-4cd7-9b0b-41919e73ae62/graph) confirms a nice performance improvement and thousands of functions no longer called. Commits ------- 3b8d6d1 Improved performance of LoggerDataCollector
…reguiluz) This PR was merged into the 4.3-dev branch. Discussion ---------- [VarDumper] Improve performance of AbstractCloner | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | - <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | - While profiling Symfony in "dev" environment (see #29762) I found that `VarCloner::addCasters()` was making thousands of `strtolower()` calls. ![varcloner-addcasters](https://user-images.githubusercontent.com/73419/50694461-40a1bd80-103a-11e9-83c0-a28b8f8f161e.png) In this PR I propose to remove all those calls. I think it's possible to do it ... but I could be completely wrong, so please review. ----- As a side note, in the past we did the same `strtolower()` to service IDs and parameter names. We stopped doing that in Symfony 3.3 and it gave us a small performance improvement (same as we could gain here). If the `strtolower()` calls of `VarCloner::addCasters()` are made just to apply the caster even if the class name is wrongly spelled, I think we could make this change. My guess is that nothing would break for the user (unlike removing the `strtolower()` in DependencyInjection, which broke wrongly spelled services and params). Thanks! Commits ------- cff23e5 [VarDumper] Improve performance of AbstractCloner
My feeling is that Symfony's "dev" environment is more and more slow lately. After profiling the Symfony Demo app with Blackfire, I found that
getContainerCompilerLogs()
is one of the slowest methods.Given that you rarely need or look at these "compiler logs", in this PR I propose to get them only when/if you really need them.
The before/after profile comparison confirms a nice performance improvement and thousands of functions no longer called.