Sonata Support for Symfony2

I am new to Symfony2 and I must admit that I like it. I started playing with SonataAdmin, but soon there was a serious doubt: does it normally take almost 3 seconds to load a listing page (using an empty database)? I know that in production I have to go to APC or memcache to speed things up, but it seems to me that this takes a very long time.

I am developing a virtual machine with a turnkey lamp (1 GB).

My computer is pretty new: Intel i3 8Gb processor.

Please tell me what you think / worry.

Thanks.

+2
source share
1 answer

In a development environment, it is difficult to measure performance, because the framework and packages sometimes have to parse many configuration files, introspectively view objects, and perform a time-consuming task and cache output.

In the production process, many things are done in advance, i.e. when deployed to your web server. Work is done in advance so as not to analyze files, do a lot of time, etc. It is for this reason that you can’t practically change anything without having to php app/console clear:cache again after making the changes. Even changing one Twig template requires that the cache be cleared to update the output presented to the end user.

I have not tested this package personally, but the admin generator package must check many properties and objects for the correct operation of its task. It really takes a lot of time, but it is only required in development mode. During the production process, this introspection process is not required, and the information is probably cached somewhere. This should lead to better performance in the production environment than in the development environment.

On the bottom line, I don't think this package suffers from a performance problem, but it depends on your needs and goals. The only thing I can be sure of: test it in production mode to see the speed that it will give you at the end. Clear the cache for production mode and use app.php instead of app_dev.php . Also, check the documentation for performance , which can be found at symfony.com.

 php app/console cache:clear --env=prod --no-debug 

Hope this helps.

Respectfully,
Matt

+6
source

Source: https://habr.com/ru/post/906148/


All Articles