I recently answered a similar question. You can find my previous answer here .
I will make a short summary. You should not measure the performance of your application based solely on the app_dev.php front controller. This controller is designed for development use only. In development, you make many changes to configuration files, branch templates, assets, etc. Symfony will check hundreds of files for modifications and reload a lot of previously cached materials, if necessary, therefore a large number of calls to filemtime , file_exists and is_readable . All these calls are bypassed in production mode because Symfony expects everything in the cache to be updated. Thus, almost everything possible is cached in production mode and is used straight forward without Symfony checking if the file has been modified or not. This gives a huge performance boost, because reloading individual files in development can take a long time to parse it, check dependencies on it, rewrite everything depending on these files, etc.
If you are comparing your application, compare it as if it were in production mode. At the very least, if you cannot install all of the hardware as you expect in the production process, follow these steps. Clear the cache for production mode and use app.php instead of app_dev.php . Also check out the performance section, which can be found on symfony.com in the documentation. Here the console calls to clean and warm up your cache in a working environment. I think cache:clear also heats the cache, but since I'm not 100% sure, I prefer to make both calls:
php app/console cache:clear --env=prod --no-debug php app/console cache:warmup --env=prod --no-debug
Hope this helps.
Regards, Matt
source share