TQ
dev.com

Blog about software development

Subscribe

Zola SSG is 4x faster than Hugo

05 Mar 2023 - by 'Maurits van der Schee'

Zola is a very fast static site generator written in Rust with 10k stars on Github. It is faster than Hugo (written in Go) that has 65k stars on Github. But there are more reasons that Zola may become the new world's most popular Static Site Generator (SSG). In this blog post I will list the things I've found to be better about Zola than Hugo and the other way around.

What did Github do?

Let's start with some history. Static site generators became really popular with the adoption of Jekyll on Github pages. Unfortunately Github decided that they didn't want to update their Jekyll runners. Also the performance differences between Jekyll and Hugo were very big: A site that would build in 340 ms in Hugo would take over 14 seconds to build in Jekyll (factor 40 wall clock time) as you can read here. Another comparison can be found here.

Jekyll had Liquid, Zola has Tera!

Hugo is world's most popular SSG, but it is notoriously hard to learn, especially the template language. Jekyll was using Liquid, which was easier to learn. Zola uses Tera, which looks a lot like Liquid (and like Jinja2, Django templates or Twig). This makes it easier to convert a site from Jekyll to Zola than from Jekyll to Hugo.

Is Zola really faster?

Build times are great with Hugo, but they are absolutely mind-blowing with Zola. To prove the claims I had read (here) I converted a (real) site with 50 pages from Hugo to Zola and measured the build times. These are the build times (as measured by the GNU/Linux "time" command):

Hugo
====
real   0m0,178s
user   0m1,897s
sys    0m0,048s

Zola
====
real    0m0,036s
user    0m0,123s
sys     0m0,052s

As you can see I went from 178ms build time to 36ms build time ("real" or "wall clock" time), roughly a factor 4. On the CPU load ("user" and "sys" time combined) the load decreased by roughly a factor 11: from 1945ms to 175ms. This means that users see their sites faster and that the CPU load on the (build) servers is lower.

Where Zola is better than Hugo

Where Hugo is better than Zola

Conclusion

IMHO Zola is a great alternative to Hugo. It is faster, has an easier to learn template language and has a nice search feature built-in. The documentation was good enough for me and the error messages got me up to speed pretty fast. I felt the developer experience was better than it was with Hugo. I fully recommend to give it a try: I feel this is the most promising static site generator there is right now.

Links


PS: Liked this article? Please share it on Facebook, Twitter or LinkedIn.