I was going to port a custom webstore application to Laravel, so that it's new, shiny and is a pleasure to support. After spending a couple of hours on setting up the framework and starting to port the main layout, I decided to test how it performs. I have installed a copy of my original app and the ported part to laravel, where I set up a Section model with a translation from dimsav/laravel-translatable and output the main navigation with Section::all() of about 30 sections.
I was shocked when I saw the result of simple observation of the Netwrok tab in Firebug:
For my laravel setup it takes roughly 360ms to render just the above. I imagine how much the response time will be when the whole page would be ported...
For the original app it takes ~30ms to serve the whole homepage with the same navigation, popular products, submenus, footer navigation, checking cart contents etc.
Both on the same virtual server and even using the same database, no caching in either.
I profiled the code to discover any issues, but all I found is that
- 6.4% is spent on autoloading (32ms - more than the whole requesto for the other version),
- 12.5%/63ms - service registerting
- 11.1%/56ms - configuration loadig
- 44.5% on endless Pipline calls. about the time seems to be spent on endless Pipeline calls.
Just to confirm, an empty laravel app responds in about 17ms.
Am I missing somethign here? I imagined there would be some performance degrade when moving to the framework, but (assuming the reponse time will increase for the complete setup, so I would expect ~20x) 20x seems crazy. Are these time normal for laravel and is there any big win from using caching (Redis for instance) or any other optimization techinques? I wonder if there actually are any except for caching?