Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #29777 [VarDumper] Improve performance of AbstractCloner (javie…
…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
- Loading branch information