-
-
N
8000
otifications
You must be signed in to change notification settings - Fork 9.6k
Performance comparison of 3.3.9 vs 4.0 beta2 #24808
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
Comments
Was this test conducted at an SSD based system or harddisk? And was opcache enabled? |
Is there a special reason you didn't profile the application with a warmed up cache? |
@javiereguiluz I think it's important you clarify what kind of performances you are looking for: dev & prod performances. Obviously dev performances are not as important, although you don't want it to be too slow either. For production performances, I think the basic optimization steps should be followed otherwise benchmarking them is useless:
I would also be curious to have the actual blackfire profile :) |
I've updated the description with more information:
@xabbuh not sure what do you mean. I cleared the cache and fully regenerated it before performing each benchmark. In any case, if I did it wrong, I did the same for all benchmarks, so it doesn't matter. @theofidry prod is more important, but dev is super important. "dev" is what you see all day every day as a developer. It can't be slow. |
Your PR description only says you cleared the cache, not fully regenerated it. It's better to always start with a freshly warmed-up cache, as that's the case with your prod app normally as well. |
don't show percentages, show ms response time for both columns and amount of RAM, percentages are sometimes deceiving |
@cordoval a percentage can be consistent from a machine to another whereas the time can greatly differ |
you need always a scale, just as a reference, when you take a look at google maps you have a horizontal bar of 1 mile or 1 kilometer to give you the idea of the scale, that is. |
I have some similar results on my biggest app when comparing I used
The only package changed is I tried each version multiple times and the results are consistent to +- 0.5ms.
|
which new PRs/changes those function call explosion is coming from/correcto to? from the components or classes? |
As always, reproducer welcomed. |
I'm currently doing binary search to find the commit 😄 Went back quite a few commits on 3.4 and now its the same performance as 3.3. Will let you know once I found out more. |
This is a part of the git history of 3.4:
The last commit where 3.4 is equally fast as 3.3 is @nicolas-grekas any idea? |
No idea, if anything, this should impact compile time only, but the bench are about runtime diffs? |
Ok after some profiling, debugging and slack discussions with @nicolas-grekas I think we found the issue: 537c496...a442e37#diff-687bdbb38a4dc672ca2a79f23e764892L127 Replacing this compiler pass with a "tagged argument" is now also done for debug=false whereas before it was only added for debug=true. Means now the I will work on a PR to fix the issue. |
@javiereguiluz can you benchmark the symfony demo again with this change? https://github.com/symfony/symfony/pull/24824/files#diff-0e793081ceb720201745c982a568903fR364 For me the performance is now pretty much the same again as on 3.3. |
…s for no-debug (dmaicher) This PR was merged into the 3.4 branch. Discussion ---------- [FrameworkBundle][Config] fix: do not add resource checkers for no-debug | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24808 | License | MIT | Doc PR | - As mentioned within #24808 replacing the `ConfigCachePass` here 537c496...a442e37#diff-687bdbb38a4dc672ca2a79f23e764892L127 with a tagged iterator argument resulted in resource checkers being added even if debug=false. This resulted in a performance drop as on every request all the checkers have been checked. This restores the previous behavior and does not add any checkers if debug=false. Commits ------- 645f712 [FrameworkBundle][Config] fix: do not add resource checkers for debug=false
@dmaicher I've tested your patch and it improves things a lot. Instead of ~15% worse performance, now I see just ~4% worse performance. But your patch is only for |
@javiereguiluz ok thanks for confirming. My patch does not have any impact on Maybe we should reopen here? the +20% for dev are indeed a bit too much I guess 😢 |
I have similar results here : phpbenchmarks.com Each Symfony version drop down query per seconds :( |
@steevanb interesting! Can you show me where cache warmups happens for Symfony? I don't see it in https://github.com/phpbenchmarks/symfony-3-4 but maybe I missed it? |
You can find benchmark protocol here :
|
@steevanb there is one step missing: calling |
Just FYI: I benchmarked again two pages (html page and a json api endpoint mentioned above) with |
@nicolas-grekas interesting. Which ones? |
eg the annotations' cache |
Humm, didn't know that ... Are you sure If it's true, for now i'm lucky, i don't use annotation. But that's weird. |
Yes I am :) |
Ok, good information ! I don't think it will change my results for now, but i will add it for news benchmark. Thanks ! |
Well it's unlikely to be an issue unless for benchmarks and read-only environments which is why the issue can easily get unnoticed |
@nicolas-grekas is there any reason for that? Shouldn't we generate the caches at the first request? |
That's always been the case in fact: cache warmers are heavy processes. Eg parsing ALL Twig templates on the first request, or ALL annotations, etc. would mean paying a high price in dev (or prod). |
We're so close to 4.0 release that I wanted to analyze its performance in comparison with 3.3. If my profiles are correct, then I'm disappointed because Symfony 4.0 is significantly slower, both at
dev
andprod
.Context
The analyzed application was Symfony Demo. I used
master
branch for Symfony 3.3.9 and symfony/demo#673 for Symfony 4.0 beta2.I executed
rm -fr var/cache/*
andcomposer dump -o
and restarted my web server before each benchmark (3.3.9 dev, 3.3.9 prod, 4.0 beta2 dev 4.0 beta2 prod).The environment was PHP 7.1, Apache, SSD disk, OPCache enabled, Xdebug disabled, native PHP (no Docker or VM).
Results for PROD environment
(differences are from 3.3 to 4.0; positive values means worse performance)
/
/en/blog/
/en/blog/posts/lorem-ipsum-dolor-sit-amet-consectetur-adipiscing-elit
/en/admin/post/
/en/admin/post/1/edit
Results for DEV environment
(differences are from 3.3 to 4.0; positive values means worse performance)
/
/en/blog/
/en/blog/posts/lorem-ipsum-dolor-sit-amet-consectetur-adipiscing-elit
/en/admin/post/
/en/admin/post/1/edit
In the
dev
environment, there's an explosion of new function calls. Example:The text was updated successfully, but these errors were encountered: