I started programming in symfony - many people praise and everything seems fine. But only in terms of performance is something slow. (Whether I have something with my computer, but it’s not the oldest either, but sometimes the page (even!) Can be loaded from the local host for 5-8 seconds.)

Read that Phalcon. They write - one of the fastest.
Should I use it?

What are the disadvantages and advantages about symfony?

  • It depends on the purpose for which you are looking for a framework. And the task can already be selected and compared. Phalcon is not a panacea either - Jekis

4 answers 4

I apologize for writing off-topic, but see the debugger in chrome, what exactly is loading from you in 5-8 seconds. Or you can start the site with app_dev.php, it will say how much Symfony loads the page, it seems to me that the problem is still not in Symfony.

    Symfony in a dev-environment is very slow, because each time it counts the container, writes a lot to the logs. If used in conjunction with Vagrant, which works very slowly with the file system in shared folders.

    You can go to Ubuntu - everything will work there much faster. In production, too, everything works very fast.

    In Windows + Vagrant, you can optimize - for example, move APP/var/cache to /dev/shm/YourAppName/var/cache . But it would be nice to have a container built in the files, because PhpStorm takes data from it for autocompletion and code validation. In my app/AppKernel.php :

     public function getCacheDir() { return $this->getVarOrShmDir('cache/' . $this->getEnvironment()); } public function getLogDir() { return $this->getVarOrShmDir('logs'); } private function getVarOrShmDir($dir) { $result = dirname(__DIR__) . '/var/' . $dir; if ( in_array($this->environment, ['dev', 'test'], true) && empty($_GET['warmup']) && // to force using real directory add ?warmup=1 to URL is_dir($result) && // first time create real directory, later use shm file_exists('/bin/mount') && shell_exec('mount | grep vboxsf') // only for VirtualBox ) { $result = '/dev/shm/' . 'YourAppName' . '/' . $dir . '/' . $this->getEnvironment(); } return $result; } 

    In php.ini can make more use of the cache, not the disk:

     realpath_cache_size = 4096k realpath_cache_ttl = 7200 

    You can disable Xdebug:

     xdebug.remote_autostart=0 xdebug.remote_enable=0 xdebug.profiler_enable=0 

      the speed of phalcon is faster than any php framework as phalcon is provided as an extension to php. But it is worth considering the fact that the speed of development on phalcon is slower. There are also fewer plug-ins available for it. Real tests show that he is 15-20 percent faster compared to symphony or yii and only 10% more laravel than I did. Basically believe routing winnings, and phalcon is just perfect for restAPI applications. Also phalcon is quite simple. I like phalcon however there are problems with implementation.

        The phalcon speed will have advantages if your application only uses phalcon. Phalcon is a very poor framework, it has a basic industrial set of components, and that’s it. You will have to add the lion's share of logic yourself, and having implemented everything you need with your own hands there are no advantages of C - there will be no expansion.

        At one time, I was also interested in this Framework as well as others, and as a result I was very discouraged. Programming with phalcon you will notice that there are not enough obvious things, and you can’t implement many of them, as many classes or methods cannot be extended due to the fact that they are “final”.

        And if you look at the sources on a githaba, you will understand that the developers have no experience with the carriage. For example, the getUri method in the Request component. Is everything okay on the right?

        Choosing between Phalcon and Symfony, I would suggest paying attention to the latter.