Twig icon indicating copy to clipboard operation
Twig copied to clipboard

Performance regression since v3.9.0

Open vbrouet opened this issue 1 year ago • 1 comments

          What is the performance impact of the runtime check combined with yield ?

Originally posted by @stof in https://github.com/twigphp/Twig/pull/3999#pullrequestreview-1875847101

Hello,

While investigating a performance regression in a symfony app (6.4) I found that the source was twig/twig version 3.9.0.

I made a small repro and used git bissect to find this pull request #3999 where performance is briefly discussed.

After some trial and error, performance was partially restored by passing 'use_yield' => true to the twig Environment constructor.

Not sure if this is a bug but in certain cases the performance impact was pretty huge (from 800 ms to 2200ms).

vbrouet avatar May 30 '24 16:05 vbrouet

Probably related to this discussion I opened a few days ago

j0r1s avatar Jun 02 '24 13:06 j0r1s

Fixed by #4216

fabpot avatar Aug 19 '24 16:08 fabpot