Latte performance is worse after upgrade 2.3.7

Notice: This thread is very old.
vojtech.kurka
Member | 11
+
+2
-

We've just upgraded Nette from 2.3.3 to 2.3.7. It seems that Latte template compilation is much slower (about twice slower) than the older version.
On some pages our server spends more than 800 msec (cpu time) on a single request.

Did anybody test the performance regression before the release?

Does anybody compile the templates before they are deployed to production to reduce the performance penalty of compiling templates in production?

Thanks, Vojta

David Grudl
Nette Core | 8082
+
0
-

I did not notice any difference between 2.3.0 and the latest 2.3.6 or master.

norbe
Backer | 405
+
0
-

Maybe guys from slevomat or rohlik play with that? I think that I shortly spoke with @OndřejMirtes about compilation of templates before deployment last year.

vojtech.kurka
Member | 11
+
0
-

David: if it's not a regression, than I'm sorry about my post. Anyway, do you thing it could be faster? I this case, even PHP7 won't help much. 400 msec, which is my estimate on PHP7, is still a long time. But I did not test it on PHP7 yet.

Thank you

Tomáš Votruba
Moderator | 1114
+
0
-

@vojtech.kurka Could you detect which exact release does this?

vojtech.kurka
Member | 11
+
0
-

Tomáš Votruba wrote:

@vojtech.kurka Could you detect which exact release does this?

It's 2.3.7 – but it doesn't seem to be a regression. I don't have older versions of Nette to at my hands to test our codebase on that.

David Grudl
Nette Core | 8082
+
+3
-

Latte is not optimized for speed, because it is good enough. On PHP7 is compilation cca 10× faster, so further optimization will not be needed.

(Of course, if someone will find bottlenecks and accelerate Latte, I'll be happy. But it's not on my TODO)

vojtech.kurka
Member | 11
+
0
-

David Grudl wrote:

Latte is not optimized for speed, because it is good enough. On PHP7 is compilation cca 10× faster, so further optimization will not be needed.

(Of course, if someone will find bottlenecks and accelerate Latte, I'll be happy. But it's not on my TODO)

OK, thanks

Jan Tvrdík
Nette guru | 2595
+
0
-

@vojtech.kurka Have you tried to profile it to see what makes it so slow?

vojtech.kurka
Member | 11
+
+2
-

Jan Tvrdík wrote:

@vojtech.kurka Have you tried to profile it to see what makes it so slow?

Yes, it's the 2nd comment (with link) on this page.

vojtech.kurka
Member | 11
+
0
-

David Grudl wrote:

Latte is not optimized for speed, because it is good enough. On PHP7 is compilation cca 10× faster, so further optimization will not be needed.

(Of course, if someone will find bottlenecks and accelerate Latte, I'll be happy. But it's not on my TODO)

I'm testing a real page compilation on PHP 7.0.0 (http://www.domodi.de/…n/sportlich/), it' just about 25% faster, not 10× faster, still takes about 700 msec.

When you achieved 10× performance gain, was it a real page test or some synthetic benchmark?
Thank you, Vojtech

vojtech.kurka
Member | 11
+
0
-

vojtech.kurka wrote:

David Grudl wrote:

Latte is not optimized for speed, because it is good enough. On PHP7 is compilation cca 10× faster, so further optimization will not be needed.

(Of course, if someone will find bottlenecks and accelerate Latte, I'll be happy. But it's not on my TODO)

I'm testing a real page compilation on PHP 7.0.0 (http://www.domodi.de/…n/sportlich/), it' just about 25% faster, not 10× faster, still takes about 700 msec.

When you achieved 10× performance gain, was it a real page test or some synthetic benchmark?
Thank you, Vojtech

Ooops, I'm sorry, it's not just Latte template compilation, it's also RobotLoader. That means, I will need to make that faster, Latte seems acceptable (about 350 msec on that page, 27 templates).

Jan Tvrdík
Nette guru | 2595
+
+3
-

@vojtech.kurka RobotLoader can be easily replaced with composer class map. You just need to manually call composer dump-autoload after moving/addding a class.