You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executed in a loop (actually when using phug inside an event-based framework like workerman), the performance of the optimizer is slow (6ms when compared to Fenom 0.1ms).
In my test, caching the 2nd parameter of isExpired reduced the execution time from 6ms to 0.6ms. Still slower than Fenom's 0.1ms.
The remaining difference of 0.5ms I assume is because Fenom compiles template to an anomyous function + echo compared to pug which uses extract and include.
The text was updated successfully, but these errors were encountered:
Looking at the code it seems that getSourceAndCachePaths is still called whether up_to_date_check is set to true or false. In my profiling data, getSourceAndCachePaths takes about 4.6ms.
Hi,
When executed in a loop (actually when using phug inside an event-based framework like workerman), the performance of the optimizer is slow (6ms when compared to Fenom 0.1ms).
This can be improved by caching the 2nd parameter to
isExpired
at https://github.com/phug-php/phug/blob/master/src/Phug/Phug/Phug/Optimizer.php#L130.In my test, caching the 2nd parameter of
isExpired
reduced the execution time from 6ms to 0.6ms. Still slower than Fenom's 0.1ms.The remaining difference of 0.5ms I assume is because Fenom compiles template to an anomyous function +
echo
compared to pug which usesextract
andinclude
.The text was updated successfully, but these errors were encountered: