welpo / tabi

A modern Zola theme with search, multilingual support, optional JavaScript, a perfect Lighthouse score, and a focus on accessibility.
https://welpo.github.io/tabi/
MIT License
97 stars 32 forks source link

Long build times - what could be the reason? #327

Closed stalkerGH closed 1 week ago

stalkerGH commented 3 weeks ago

I'd like to know how can I check the reason of long build time of my webpage created with tabi theme. It has only 12 pages but build time is about 15 seconds. Adding every 1 page (I have several drafts) extends this time by ~1 second.

I have also another blog converted from Wordpress to Markdown but with zolarwind theme. It contains 73 pages and builds in 2 seconds.

I use latest Zola (0.18.0) and latest tabi (I hope).

welpo commented 2 weeks ago

Of course :) No rush at all~

stalkerGH commented 2 weeks ago

Good morning! I'm back, ready to testing.

Good news: your change works!

With read_metadata = true option it takes 10.5 seconds to render 15 pages.

With the option read_metadata = false it takes 3.5 seconds to build. It's still a long way from milliseconds, but that's probably because in addition to the full_width_image code I'm still using image_toggler, which requires analogous changes.

welpo commented 2 weeks ago

Thank you for reporting back!

In conclusion: WebP is the culprit.

I'm not sure what to do. I could add the read_metadata options to all image shortcodes, but it feels like a hack and not a proper solution. I've replied to the Zola repo discussion in hopes of figuring out how how this could really be fixed.

I'll wait for an answer before deciding. If fixing this on Zola/a library Zola uses is not feasible, I'll probably add the feature to the shortcodes and document it. I'm thinking a general config.toml setting would help make things simpler if I add this.

stalkerGH commented 1 week ago

I see no reaction on Zola's issue tracker. Maybe because it's very old thread - over 1 year? Maybe I should start new one?

EDIT: after some digging, I got great news. Something has changed in Zola's internals because rendering is incredibly fast even for WEBP images. I installed 0.19.0 but zola serve wasn't working. I've noticed that it is a bug, fixed in 0.19.1. I've installed it and my page is rendered in milisecongs. I've reverted to original shortcodes (vanilla) of tabipackage and it works like a charm. Also with versions with read_metadata = false but it is not necessary now, I think.

So, it seems the "the bug" or whatever it was is repaired. Great :)

welpo commented 1 week ago

Thank you so much for reporting back!

I tested my site (with a bunch of webp files) and it's much faster building as well. Yay! 🎉

stalkerGH commented 1 week ago

Thank you for great work and your willingness to help!