Hacker News new | ask | show | jobs
by piotrkubisa 2238 days ago
The really nice thing of Symfony framework is database schema mapping and migrations, which have compatibility with numerous database systems and provides abstraction layer [0], that among many options of interfaces have quite handy YAML-formatted schema mapping [1]. Nothing extraordinary these days but it is really stable and simple to use.

[0]: https://symfony.com/doc/current/doctrine.html

[1]: https://www.doctrine-project.org/projects/doctrine-orm/en/2....

1 comments

Do you ever profile doctrine? I found its overhead to be 10x the actual time of my average query. Most of the time is spent hydrating. I wonder how people can put up with such a level of performance reduction and still claim they are using decent tools.
Of course! I believe almost all PHP devs noticed, they have terrible slowdown by Doctrine and used XDebug to check where is the problem. I am not PHP dev anymore and I hope it has improved a lot since my last adventure with this ORM but I'd still advocate to not use it on client-facing interface - you can use Doctrine only for database management (CLI), while for web interface use raw PDO or equivalent (Eloquent). You can also use cache or transform page into static-site. Sky is the limit.
Oh doctrine, those were the days... I spent a couple years working on a project that was eventually rewritten in rails because there was a memory leak that required restarting the server ever night via cron.
Yeah, PHP scripts in CRON, especially those using some relational database were my nemesis that time too. The nice thing, which in PHP 5.5 was introduced is generators, that almost completely resolved the problem with memory leakage in such scripts IMHO.

[0]: https://www.php.net/manual/en/language.generators.overview.p...