Performace hit on complex project heavily customized

sucotronic
Member | 2
+
0
-

A client asked me help with a project where they've been using latte for a long time.
The thing is that I'm trying to profile it, and the only thing that seems to “cost” processing is “MacroTokens” processing:

https://imgur.com/a/5VMc27e

After digging a bit, it seems that tokens are just the keywords in the templates, and there a lot of them in the project (even custom ones).

I've trying to replicate this behaviour with a small template, but there's no mention to MacroTokens, even if I add custom macros https://latte.nette.org/en/develop#…

I would like to ask about what is the purpose of MacroTokens class, and if it's normal that it's called +200k for rendering a simple page.

David Matějka
Moderator | 6445
+
+2
-

This only happens when Latte is compiling a template. Is the temp directory configured? (see setTempDirectory method)

sucotronic
Member | 2
+
+6
-

Thank you so much @DavidMatějka !!! For some weird reason, the project has a directory “tmp/nettecache”, but it was empty all the time. The setTempDirectory() function was buried under various levels of configs, and after setting it, now everything is blazingly fast!