Website slow down – after update to latte/latte 3.0.4

m.brecher
Generous Backer | 872
+
0
-

Hi,

I have upgraded from latte/latte 2.11.6 to latte/latte 3.0.4 and noticed remarkable drop of the speed of the website.

latte/latte 2.11.6: page render time approx. 70 ms, 165 included files
latte/latte 3.0.4: page render time approx. 140 ms, 260 included files this edited 1.3.2023

I have tested all upgraded packages and only latte is responsible for the problem. I have PHP 8.2.3. No db query on tested page, latte templates were compiled.

Is there any solution how to come back to the previous speed with the newest version of latte?

Last edited by m.brecher (2023-03-01 02:33)

Marek Bartoš
Nette Blogger | 1275
+
0
-

Latte runtime should not be much different from previous versions. Probably best would be to profile page with blackfire.io to check what takes so much time

mystik
Member | 312
+
0
-

That is weird because main difference between Latte 2 and LAtte 3 was in process of compilation. Rendering of compiled templates is mostly the same.

Can you post diff of compiled Latte 2 and Latte 3 version of given template?

And as @MarekBartoš suggested try profiling. To find out where bottleneck is.

Last edited by mystik (2023-02-26 18:26)

m.brecher
Generous Backer | 872
+
0
-

@MarekBartoš and @mystik

Thank both for comments,

yes, I will do more testing of the case. The bottleneck looks 90% sure 100 more of included files in latte 3.0.4 comparing 2.11.6 (on the same page). That is what I intend to inspect carefully – do the list of the files in both versions of latte and compare them. And see what files (classes) are loaded additionally and decelerate the website speed. I note that I run PHP 8.2 od Apache + Windows 10.

But it would be also wise to compare the numbers with some other developers. Please do one of you a small test od simple page from layout with one action latte file without db query on these two latte versions:

latte/latte 2.11.6
latte/latte 3.0.4

and post me into this thread a) render time b) number of included files (Tracy)

My numbers are in my first post here, it would be interesting to compare them.

I will post the list of additionally included approx. 100 files (classes) in latte 3.0.4 – this probably will show the root of the problem.

Last edited by m.brecher (2023-03-01 00:33)

m.brecher
Generous Backer | 872
+
0
-

Hi,

the root of the problem has been found. The latte templates are repeatedly endless compiling and in the directory /temp/cache/latte after every rendering of the same page appears new and new compiled files.

A few days ago I have found another cache problem in latte translations of template texts and posted this here:

https://forum.nette.org/…latte-v3-0-4

but that problem was in OS Windows only. This new caching problem is Windows/Linux independent.

T have tested this on my home developer machine with Windows and also on Linux server on webhosting – the same problem with endless compiling latte files is on both servers.

The problem can be made also by conflicts between versions of different nette packages, because simple composer update offers latte/latte 2.11.6, not latte/latte 3.0.4.

I have installed this packages:

latte/latte		v3.0.4
nette/application	v3.1.8
nette/bootstrap		v3.1.4
nette/caching		v3.1.4
nette/component-model	v3.0.2
nette/database		v3.1.6
nette/di		v3.1.0
nette/finder		v2.6.0
nette/forms		v3.1.9-RC
nette/http		v3.2.1
nette/mail		v3.1.9
nette/neon		v3.3.3
nette/php-generator	v4.0.5
nette/robot-loader	v3.4.2
nette/routing		v3.0.3
nette/schema		v1.2.3
nette/security		v3.1.6
nette/utils		v3.2.8
tracy/tracy		v2.9.5

Last edited by m.brecher (2023-03-01 03:01)

David Grudl
Nette Core | 8228
+
+2
-

Why are you using Latte 3.0.4, where the cache problem was, and not version 3.0.5, where it's fixed?

m.brecher
Generous Backer | 872
+
0
-

@DavidGrudl

Why are you using Latte 3.0.4, where the cache problem was, and not version 3.0.5, where it's fixed?

Yes, after composer require latte/latte 3.0.5 the speed of the page is OK. Thank for your help. I could have thought of upgrading to the latest version of the latte/latte myself too :).