Integration with profiler
NotJustPizza opened this issue · comments
Is it possible? Integration with profiler like Twig has?
Phug project will come with a very better debug tool, not something like that but what I hope to do is a mapper between compiled code and source code when an exception occurs.
But I don't see the point of counting the blocks and mixin calls since you should cache all compiled template in production (see php bin/console assets:publish --env=prod
in https://github.com/pug-php/pug-symfony#deployment)
If you calculate data in your controller and just use pug for display them (that is the very recommanded way to use a template engine), performances will not be a big concern in views, you will only have to profile your controllers, database calls etc.
If compiled templates are slow to render, that means you did something wrong in templates like call your database in a each
those kind of problem are not really about how your includes, mikins or blocks are structured but simply doing something in pug that should not be done on the fly in the view and so should be moved in your controller. It could be interresting to detect those pattern breaks with an automation tools but that will not be done right in the next version.