Reduce Symfony response time with lazy runtime extensions

Photo by Cris Ovalle on Unsplash

Ever wondered why your Symfony app is so slow? One of the factors is going to be the initialization time of the Twig templating system.

Before your index.html.twig file is rendered, lots of things happen under the hood. Twig won’t render any template until every extension has been instantiated and loaded. As a result, Symfony goes through every service tagged with…