-
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
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 uses extract and include.
Metadata
Metadata
Assignees
Labels
No labels