Performance Comparison Saaze vs. Hugo vs. Zola
Zola is a static site generator written in Rust. Hugo is a static site generator written in Go. Simplified Saaze, Saaze for short, is written in PHP.
Task: Compare run times of Saaze vs. Hugo vs Zola. I didn't find a direct comparison so far. There is a comparison of Eleventy vs. Gatsby vs. Hugo vs. Jekyll vs. Next vs. Nuxt.
Installation size on Arch Linux for x86 and Odroid/ARM.
|Generator||Size/MB x86||Size/MB ARM|
|Simplified Saaze 1.1||0.05||0.05|
Run times are all in seconds. x86 is Intel NUC i5-4250U, 4 cores, max 2.6 GHz running Arch Linux 5.14.14; ARM is Cortex-A7, 8 core, big-little, max 1.5 GHz running Arch Linux 4.14.180-3. The 13 posts are the music posts in this blog, the 347 posts is the sum of all posts in this blog. 681 and 1349 are just copies of the 347 posts.
|Generator||#posts||real x86||user x86||real ARM||user ARM|
Initially one would think that static site generators written in Go and Rust are faster than generators written in PHP. This time, PHP beats them all.
User times in Hugo are way higher as Hugo uses threads to parallelize the task. But although it fully utilizes all the cores, it is way slower than Saaze and Zola. Neither Saaze nor Zola use threads. So if Saaze would use threads then the difference in run time would even get bigger. It would be quite easy to use threads in Saaze, i.e., so called entries and the chunks of collections could easily be processed in parallel.
Comparing the x86 real- and user-time:
Comparing the ARM real- and user-time:
Results for Hugo:
- Hugo is always the slowest, contrary to its constant bragging about "The world’s fastest framework for building websites"
- Hugo's templates are difficult to use
- Hugo is a CPU hog, also see Converting WordPress Export File to Hugo
- Hugo's Goldmark implementation does not honor plain, simple HTML
- In defense of Hugo: Hugo automatically uses syntax highlighting. This clearly slows down processing. I switched off syntax highlighting in Zola as well, otherwise Zola would be roughly two times slower.
So apparently it was a wise decision not to use Hugo for this blog, but go with Saaze instead, being way simpler to use and an order of magnitude faster.
Added 13-Jan-2022: Similar findings with regard to inferior performance of Hugo vs. Zola were found in Static site generator benchmarks. The numbers are:
|Generator||Time in ms|
Here Blade is another static site generator written by Maroš Grego. It is programmed in Rust and uses the mustache templating system.
The Nift static site generator also beats Hugo by a factor of four for real time. For user time, i.e., not accounting for multi-core CPUs, Hugo is more than 6-times slower. The results:
Nift is written in C, C++ and Lua. Source code in GitHub. It was written by Nicholas Ham.