Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does loading a lot of bundles affects the overall performance of a Symfony2 application?

I've been wondering how loading a lot of bundles in the appkernel (let's say 300+) and their routing information impacts the overall application performance?

Look at it as a matter of conditional loading of bundles for frontend and backend (providing some of them are actually needed only for only one environment) - is it worth doing it?

I know it may be difficult to answer without actually testing it in some real world scenario, but maybe someone has studied the internals of sf2 extensively enough to tell what's the scale of the problem when adding a lot of bundles and their routing configurations.

like image 253
Itako Avatar asked Oct 20 '11 11:10

Itako


2 Answers

I'm not an expert in Sf2, but I know that it compiles configurations into PHP code. So if you make things right (do not boot a bundle when sf2 is booted, for example), they will be dumped into php code which will be apc cached, too.

Regards,

like image 104
Stéphane Erard Avatar answered Nov 07 '22 16:11

Stéphane Erard


It shouldn't if it was designed properly, no. Library paths and such should be cached (APC, on disk, etc.), but it shouldn't affect performance. IF it does, switch to Lithium (http://li3.me) ha. But seriously, you can tell by using something like xdebug with webgrind or something.

like image 1
Tom Avatar answered Nov 07 '22 17:11

Tom