Replies: 4 comments 6 replies
-
"I'm puzzled by the significant performance drop from a minor version upgrade" You make it sound like we're fine with such a performance drop (and maybe that we were aware of it), which we're not obviously. This should be considered a bug that needs to be fixed if possible. To help with our investigation, could you try to write a reproducer that we can then profile with Blackfire to better understand the bottleneck? |
Beta Was this translation helpful? Give feedback.
-
If I enable the "use_yield" mode, the page rendering goes from 22s to 3s on my machine. (I'd also recommend to improve the easy-editor-bundle. The number of iterations looks unreasonable to me for the result on this page.) |
Beta Was this translation helpful? Give feedback.
-
Found this the other day... is the comment still valid today (the xdebug part) ? public function renderBlock(FormView $view, mixed $resource, string $blockName, array $variables = []): string
{
$cacheKey = $view->vars[self::CACHE_KEY_VAR];
$context = $this->environment->mergeGlobals($variables);
ob_start();
// By contract,This method can only be called after getting the resource
// (which is passed to the method). Getting a resource for the first time
// (with an empty cache) is guaranteed to invoke loadResourcesFromTheme(),
// where the property $template is initialized.
// We do not call renderBlock here to avoid too many nested level calls
// (XDebug limits the level to 100 by default)
$this->template->displayBlock($blockName, $context, $this->resources[$cacheKey]);
return ob_get_clean();
} I don't have all the history of this method.. but i kinda (maybe naively) feel that either |
Beta Was this translation helpful? Give feedback.
-
Fixed by #4216 |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
I have a CMS Symfony project using agence-adeliom/easy-editor-bundle, and over the years, the number of blocks has grown quite substantially.
Each block can be added to the page content using its prototype. However, after upgrading twig/twig from 3.8.0 to 3.9.0, I've noticed massive increases in rendering times for admin pages:
Before Upgrade:
After Upgrade:
While I understand that dumping every prototype into the DOM might not be the most efficient implementation, I'm puzzled by the significant performance drop from a minor version upgrade.
I've seen changes about the escaper in the changelog, which might be a lead.
I've narrowed down the rendering time hit to this line in the editor_widget.html.twig template:
This line is called once for every block type (49 times in my current example), and if I remove it, the rendering time improves drastically.
I would greatly appreciate any help or insights on how to tackle this issue since I prefer not to lock my Twig version to 3.8.0.
Thank you in advance for your assistance!
Beta Was this translation helpful? Give feedback.
All reactions