Sage 10 slow

We have a WP website with sage10 theme.

It is slow - 5 sec on very fast server with fast CPU, SSD disks etc.

We have LAPS / LAP plugin and it shows that “Themes Load” takes 5 sec. This is on HTML page, nothing to do with CSS, JS or downloading the content to the web browser.

Because the theme is made by someone else, I tried to debug laravel code, and found that all this time is spent when laravel try to “prepare” / instantiate the blades (templates). I can imagine the code go to each template on the disk and validate it.

This is done before WP caching layer (is executed even before wp-admin), so putting WP level cache plugins will not help (however nginx level cache will theoretically help)

Any idea what we can do in order to debug where the bottleneck is and speed up?

Hi @nmmm,

I haven’t heard of Laravel or Sage performing badly without some kind of misconfiguration or bad practice involved. Blade compilation is typically very fast.

How have you identified that Blade compilation is the source of the bottleneck? Is any more information available?

LAPS is a good start, and here’s a great thread with some further profiling techniques to try out.

My gut feeling is that if Blade compilation is slow, there’s probably logic in your templates that is the real cause of the bottleneck. If the solutions linked above don’t provide much clarity, I’d run a full XDebug profile and analyse via a callgrind utility.

3 Likes