Symfony2.5 slow Initialization time compared to Symfony2.4
Asked Answered
B

1

7

I just installed both Symfony2.4.4 and Symfony2.5.1 and set up a hello world page + some basic things I use (assetic js/css management etc). Configuration and setup for both projects are exactly the same.

I noticed that in app_dev the Symfony2.5.1 needs around 1100ms to generate the page, while Symfony2.4.4 only needs around 130ms to generate the same page. Both numbers come from the Symfony debug toolbar. When I take a look at the profiler's timeline I noticed Symfony2.5.1 uses around 900-1000ms for something called "Initialization time", while with 2.4.4 that only takes 50-60 ms.

Symfony2.5.1 enter image description here

Symfony2.4.4 enter image description here

Does anyone have an idea why it takes Symfony2.5.1 so much longer to initialize the project? I've checked the changelog for 2.5.x but haven't found anything so far. (https://github.com/symfony/symfony/blob/master/CHANGELOG-2.5.md)

Edit: Apparently the 2.5.1 rebuilds the entire dev cache on each page load, while the 2.4.4 does not. Not sure why.

Edit2: Noticed the chromehelper on my mac was running rogue (eating CPU), so I restarted the browser. Afterwards 2.5.1 doesn't rebuild dev cache anymore and load times are similar to 2.4.4. I don't get how it can be related though, how can a rogue browser influence the rebuilding of dev cache? FYI: The 2 projects are running on a virtualbox with centOS on that same mac.

Boa answered 9/7, 2014 at 6:26 Comment(4)
I just upgraded to 2.5.1 and got 1000ms+ for only the 1st page load but all subsequent loads are <100ms. Did you try refreshing?Higginbotham
Yes, I refreshed several times on both projects. I also tried manually removing cache on both, but no difference. Afterwards I restarted my chrome browser and it somehow fixed the issue (see Edit2).Boa
Do you have an accelerator? APC would be nice to test this...Evelinaeveline
Does this issue still exist, or was it solved by that browser restart? If it was solved, consider answering your own question or deleting it.Cream
B
1

The initialization time difference between both version was happening because Symfony2.5.1 was completely rebuilding its dev cache every time I loaded the page. I 'solved' it by killing off my mac/chrome browser which was running rogue.

After browser restart, 2.5.1 cache behaved the same as 2.4.4, with loading times around 130ms.

How a rogue browser can influence dev cache, I have no clue though.

Boa answered 1/8, 2014 at 8:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.