Reduce Styles Compilation Time

Hello,

Do you guys have any idea on how to reduce the styles compilation time? Because I am using redis already and I have no idea what else to do to reduce this time. (This was on a category page btw, so maybe some sort of trick to render the blocks from products quicker?)

Before styles compilation
Memory	Files	Queries	Time
357,736 (5,275,688)	28 (202)	2 (39)	0.0038 (0.0205)

After styles compilation
Memory Files Queries Time
45,049,224 (50,324,912) 2 (204) 0 (39) 0.4145 (0.4350)

Kind regards,

The less files should be compiled once and then cached for use unless you have the "Automatically rebuild css" checkbox checked on your Design/Themes page. It should be unchecked in your production environment.

I'm not sure your memory/files/query_time are a result of styles. I.e. queries should have nothing to do with styles since they're stored in the filesystem, not in the database.

It's not clear to me what looking at query time/resource usage has to do with compilation of less => css.

The less files should be compiled once and then cached for use unless you have the "Automatically rebuild css" checkbox checked on your Design/Themes page. It should be unchecked in your production environment.

I'm not sure your memory/files/query_time are a result of styles. I.e. queries should have nothing to do with styles since they're stored in the filesystem, not in the database.

It's not clear to me what looking at query time/resource usage has to do with compilation of less => css.

I was in the debug menu and took a look at the logging, this basically shows you which steps takes a lot of time.

And styles compilation is just a name for another process but it does make my page load very slow!

Here is the complete list:

Before init
Memory	Files	Queries	Time
556,384	16	0	0
Before database connect
Memory	Files	Queries	Time
363,312 (919,696)	32 (48)	0 (0)	0.0003 (0.0003)
After database connect
Memory	Files	Queries	Time
11,544 (931,240)	0 (48)	0 (0)	0.0003 (0.0006)
Session: before redis connect
Memory	Files	Queries	Time
203,208 (1,134,448)	14 (62)	10 (10)	0.0025 (0.0030)
Session: after redis connect
Memory	Files	Queries	Time
1,472 (1,135,920)	0 (62)	0 (10)	0.0002 (0.0032)
Cache: before redis connect
Memory	Files	Queries	Time
26,712 (1,162,632)	4 (66)	5 (15)	0.0009 (0.0041)
Cache: after redis connect
Memory	Files	Queries	Time
1,472 (1,164,104)	0 (66)	0 (15)	0.0001 (0.0042)
After init
Memory	Files	Queries	Time
15,847,264 (17,011,368)	95 (161)	22 (37)	0.0344 (0.0386)
Before TPL
Memory	Files	Queries	Time
992,472 (18,003,840)	17 (178)	561 (598)	0.1224 (0.1610)
Before styles compilation
Memory	Files	Queries	Time
359,920 (18,363,760)	27 (205)	1 (599)	0.0035 (0.1645)
After styles compilation
Memory	Files	Queries	Time
45,054,128 (63,417,888)	2 (207)	0 (599)	0.3542 (0.5187)
Start render location
Memory	Files	Queries	Time
-44,679,984 (18,737,904)	7 (214)	0 (599)	0.0720 (0.5907)
[Block] [Quick links] Render begin
Memory	Files	Queries	Time
277,096 (19,015,000)	3 (217)	6 (605)	0.0028 (0.5935)
[Block] [Quick links] Render end
Memory	Files	Queries	Time
100,112 (19,115,112)	17 (234)	4 (609)	0.0022 (0.5956)
[Block] [Languages] Render begin
Memory	Files	Queries	Time
3,808 (19,118,920)	0 (234)	0 (609)	0.0000 (0.5957)
[Block] [Languages] Render end
Memory	Files	Queries	Time
84,296 (19,203,216)	3 (237)	6 (615)	0.0023 (0.5980)
[Block] [Currencies] Render begin
Memory	Files	Queries	Time
3,432 (19,206,648)	0 (237)	0 (615)	0.0000 (0.5980)
[Block] [Currencies] Render end
Memory	Files	Queries	Time
40,296 (19,246,944)	1 (238)	1 (616)	0.0006 (0.5986)
[Block] [FAQ] Render begin
Memory	Files	Queries	Time
3,800 (19,250,744)	0 (238)	0 (616)	0.0000 (0.5986)
[Block] [FAQ] Render end
Memory	Files	Queries	Time
43,848 (19,294,592)	5 (243)	0 (616)	0.0005 (0.5991)
[Block] [Logo] Render begin
Memory	Files	Queries	Time
37,408 (19,332,000)	2 (245)	0 (616)	0.0004 (0.5995)
[Block] [Logo] Render end
Memory	Files	Queries	Time
36,432 (19,368,432)	1 (246)	0 (616)	0.0004 (0.5998)
[Block] [Search] Render begin
Memory	Files	Queries	Time
4,176 (19,372,608)	0 (246)	0 (616)	0.0000 (0.5999)
[Block] [Search] Render end
Memory	Files	Queries	Time
61,224 (19,433,832)	6 (252)	0 (616)	0.0007 (0.6006)
[Block] [Cart content] Render begin
Memory	Files	Queries	Time
3,432 (19,437,264)	0 (252)	0 (616)	0.0000 (0.6006)
[Block] [Cart content] Render end
Memory	Files	Queries	Time
45,928 (19,483,192)	1 (253)	0 (616)	0.0007 (0.6013)
[Block] [My Account] Render begin
Memory	Files	Queries	Time
3,432 (19,486,624)	0 (253)	0 (616)	0.0000 (0.6013)
[Block] [My Account] Render end
Memory	Files	Queries	Time
207,816 (19,694,440)	8 (261)	0 (616)	0.0018 (0.6031)
[Block] [Top menu] Render begin
Memory	Files	Queries	Time
6,416 (19,700,856)	0 (261)	0 (616)	0.0000 (0.6031)
[Block] [Top menu] Render end
Memory	Files	Queries	Time
239,888 (19,940,744)	10 (271)	64 (680)	0.0153 (0.6184)
[Block] [Breadcrumbs] Render begin
Memory	Files	Queries	Time
18,272 (19,959,016)	0 (271)	0 (680)	0.0003 (0.6187)
[Block] [Breadcrumbs] Render end
Memory	Files	Queries	Time
55,336 (20,014,352)	2 (273)	0 (680)	0.0006 (0.6193)
[Block] [Uitgebreid zoeken] Render begin
Memory	Files	Queries	Time
7,192 (20,021,544)	0 (273)	0 (680)	0.0000 (0.6193)
[Block] [Uitgebreid zoeken] Render end
Memory	Files	Queries	Time
283,528 (20,305,072)	5 (278)	17 (697)	0.0572 (0.6766)
[Block] [Category side banner] Render begin
Memory	Files	Queries	Time
3,448 (20,308,520)	0 (278)	0 (697)	0.0000 (0.6766)
[Block] [Category side banner] Render end
Memory	Files	Queries	Time
52,576 (20,361,096)	0 (278)	0 (697)	0.0004 (0.6770)
[Block] [Net bekeken] Render begin
Memory	Files	Queries	Time
3,432 (20,364,528)	0 (278)	0 (697)	0.0000 (0.6770)
[Block] [Net bekeken] Render end
Memory	Files	Queries	Time
99,648 (20,464,176)	0 (278)	0 (697)	0.0003 (0.6774)
[Block] [Category banners] Render begin
Memory	Files	Queries	Time
3,808 (20,467,984)	0 (278)	0 (697)	0.0000 (0.6774)
[Block] [Category banners] Render end
Memory	Files	Queries	Time
5,376 (20,473,360)	0 (278)	2 (699)	0.0009 (0.6783)
[Block] [Main Content] Render begin
Memory	Files	Queries	Time
3,432 (20,476,792)	0 (278)	0 (699)	0.0000 (0.6784)
[Block] [Main Content] Render end
Memory	Files	Queries	Time
1,235,320 (21,712,112)	28 (306)	0 (699)	0.0382 (0.7165)
[Block] [Mijn profiel] Render begin
Memory	Files	Queries	Time
184,072 (21,896,184)	0 (306)	0 (699)	0.0009 (0.7175)
[Block] [Mijn profiel] Render end
Memory	Files	Queries	Time
18,704 (21,914,888)	2 (308)	0 (699)	0.0006 (0.7181)
[Block] [Extras] Render begin
Memory	Files	Queries	Time
4,176 (21,919,064)	0 (308)	0 (699)	0.0000 (0.7181)
[Block] [Extras] Render end
Memory	Files	Queries	Time
14,064 (21,933,128)	1 (309)	2 (701)	0.0010 (0.7191)
[Block] [Klantenservice] Render begin
Memory	Files	Queries	Time
3,432 (21,936,560)	0 (309)	0 (701)	0.0000 (0.7191)
[Block] [Klantenservice] Render end
Memory	Files	Queries	Time
17,080 (21,953,640)	1 (310)	6 (707)	0.0018 (0.7209)
[Block] [Become a seller] Render begin
Memory	Files	Queries	Time
3,432 (21,957,072)	0 (310)	0 (707)	0.0000 (0.7209)
[Block] [Become a seller] Render end
Memory	Files	Queries	Time
19,904 (21,976,976)	2 (312)	2 (709)	0.0008 (0.7217)
[Block] [Contacteer ons] Render begin
Memory	Files	Queries	Time
3,432 (21,980,408)	0 (312)	0 (709)	0.0000 (0.7217)
[Block] [Contacteer ons] Render end
Memory	Files	Queries	Time
8,616 (21,989,024)	1 (313)	0 (709)	0.0002 (0.7220)
[Block] [Informatie] Render begin
Memory	Files	Queries	Time
3,432 (21,992,456)	0 (313)	0 (709)	0.0000 (0.7220)
[Block] [Informatie] Render end
Memory	Files	Queries	Time
10,296 (22,002,752)	1 (314)	1 (710)	0.0006 (0.7225)
[Block] [Copyright] Render begin
Memory	Files	Queries	Time
-190,560 (21,812,192)	0 (314)	0 (710)	0.0002 (0.7227)
[Block] [Copyright] Render end
Memory	Files	Queries	Time
6,400 (21,818,592)	2 (316)	0 (710)	0.0003 (0.7230)
[Block] [Footer menu] Render begin
Memory	Files	Queries	Time
3,808 (21,822,400)	0 (316)	0 (710)	0.0000 (0.7230)
[Block] [Footer menu] Render end
Memory	Files	Queries	Time
8,632 (21,831,032)	0 (316)	2 (712)	0.0010 (0.7240)
End render location
Memory	Files	Queries	Time
-20,000 (21,811,032)	0 (316)	0 (712)	0.0002 (0.7243)
After TPL
Memory	Files	Queries	Time
151,056 (21,962,088)	12 (328)	0 (712)	0.0058 (0.7301)

Those are just labels and not really reflective of the activity of any particular event. They are more like 'markers' that calculates the queries/file accesses between markers.

So you'll need to go into the code and find where those markers actually are and what activity is going on between them.

But your styles should be compiled once and cached (filesystem). And your browser should be caching those styles as well.

Those are just labels and not really reflective of the activity of any particular event. They are more like 'markers' that calculates the queries/file accesses between markers.

So you'll need to go into the code and find where those markers actually are and what activity is going on between them.

But your styles should be compiled once and cached (filesystem). And your browser should be caching those styles as well.

Do you perhaps have any idea where I can find those markers? I haven't used the debug menu a lot so could you give me a location where I will have to start digging?

Unfortunately, I've never researched it. So my effort would be the same as yours.... But my guess is that they are related

But searching for "Render begins" in the source base shows these coming from app/Tygh/Debugger.php so you might start there and identify what method these are in, then search to find where they are called. Looks like it's the internal profiller.