Latte performance is worse after upgrade 2.3.7

3 years ago

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

3 years ago

David Grudl
Nette Core | 6787
+
0
-

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

3 years ago

norbe
Backer | 400
+
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.

3 years ago

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

3 years ago

Tomáš Votruba
Moderator | 1152
+
0
-

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

3 years ago

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.

3 years ago

David Grudl
Nette Core | 6787
+
+2
-

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)

3 years ago

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

3 years ago

Jan Tvrdík
Nette guru | 2547
+
0
-

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

3 years ago

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.

3 years ago

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

3 years ago

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).

3 years ago

Jan Tvrdík
Nette guru | 2547
+
+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.