
Hugo vs Jekyll: Benchmarked
Hugo and Jekyll are the leading static site generators according to StaticGen.com, and both supported by our CMS. We’re often asked which tool performs better so we decided to do an analysis.
TL;DR
We ran two tests to measure build times with Hugo and Jekyll. The basic test used the default installation of Jekyll and Hugo to build sites with 10 posts,100 posts, 1,000 posts and 10,000 posts. The advanced test built those same sites but included common plugins and template code in order to create a similar set of features between the two Static Site Generators. For each build, Hugo proved to be between 23 and 63 times faster than Jekyll!
There are many factors one must consider when choosing a static site generator, but if you’re just looking at build times, Hugo wins hands down!
See the data below, and let us know what your build times are in the conversation on Hacker News.
Preparing The Test
In order to fairly compare Hugo and Jekyll, we needed to ensure they were on an equal playing field.
To do this, we came up with a list of requirements for the test:
Equal Content
For each test, we created a basic YAML content model and then generated sites with 10
, 100
, 1,000
, and 10,000
posts using this model for both Jekyll and Hugo.
Equal template structure
We didn’t want theme template structure to affect build times so we put together archive, single, and taxonomy templates for each test with the minimum amount of HTML markup needed, no CSS or JS to process or compile, and used the same data for both Hugo and Jekyll.
1:1 feature comparison
Each static site generator has a different set of features. For instance, Hugo builds your sitemap, whereas Jekyll requires a plugin to do so. For this reason, we created two tests.
- Basic Test - Without any plugins
- Advanced Test - Using common plugins and code to achieve a similar set of features (i.e. sitemaps and feed generation).
Running the Benchmark
We ran the benchmarks using a simple bash script. Each benchmark runs the build process 13 times recording the real
time output from the Unix time
command. We took the average of these 13 builds to get our final result.
The Basic Benchmark
For the first benchmark, we generated content with a title, a body, and a date in the templates. The content looked like this:
Hugo
---
title: Test 1
date: 2017-07-17T13:48:56-03:00
---
# Page Headline
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eget urna nisl. Donec rhoncus libero eget tristique dapibus. Nullam ultricies ullamcorper ipsum sed lacinia.
Jekyll
---
title: Test 1
layout: post
---
# Page Headline
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eget urna nisl. Donec rhoncus libero eget tristique dapibus. Nullam ultricies ullamcorper ipsum sed lacinia.
This was the most basic benchmark possible, testing only how fast Hugo and Jekyll build the same number of posts.
As you can see below, Hugo is a clear winner building each site in under 1 second.
Basic Test with 10, 100, and 1,000 posts.
Plotting a 10,000-page site next to these shows how significant the difference in build-times can become (notice the change in scale of the Y-axis).
Basic Test with 10, 100, 1,000 and 10,000 posts.
The results from this test are as follows:
Generator | 10 | 100 | 1,000 | 10,000 |
---|---|---|---|---|
Hugo | 0.05s | 0.08s | 0.34s | 2.95s |
Jekyll | 1.47s | 3.3 | 14.38 | 187.15 |
The Advanced Benchmark
For the next benchmark, we generated content with a title, body, date, categories, and tags. We enabled the generation of category and tag archives, and also generated an XML sitemap and RSS/Atom Feed.
These are some of the core features a basic blog or documentation site would need, so we felt this was a fair and representative benchmark.
In this case, our content looked like this:
Hugo
---
title: Test 1
categories:
- red
- orange
- yellow
- green
- blue
- indigo
- violet
tags:
- red
- orange
- yellow
- green
- blue
- indigo
- violet
date: 2017-07-17T14:07:58-03:00
---
# Page Headline
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eget urna nisl. Donec rhoncus libero eget tristique dapibus. Nullam ultricies ullamcorper ipsum sed lacinia.
Jekyll
---
title: test_1
tags: red orange yellow green blue indigo violet
categories: red orange yellow green blue indigo violet
layout: post
---
# Page Headline
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eget urna nisl. Donec rhoncus libero eget tristique dapibus. Nullam ultricies ullamcorper ipsum sed lacinia.
Looking at the results below, you can see that Hugo is again the winner. It’s clear that as you add complexity to Jekyll the decrease in performance is much more noticeable.
Advanced Test with 10, 100, and 1,000 posts.
Adding a 10,000 page test dwarfs the data from the previous graph.
Advanced Test with 10, 100, 1,000 and 10,000 posts.
The results from the second test are as follows:
Generator | 10 | 100 | 1,000 | 10,000 |
---|---|---|---|---|
Hugo | 0.06s | 0.12s | 0.65s | 7.46s |
Jekyll | 1.38s | 3.8 | 18.42 | 218.61 |
Other Thoughts
It’s important to note that these tests were run in an environment where all of the necessary components were downloaded and installed beforehand.
Given that Jekyll has plugins where Hugo doesn’t, in cloud or server environments where Gems need to be downloaded, they will add additional time to builds (e.g, Forestry’s preview feature).
Incremental Builds
Both Hugo and Jekyll have a built-in server that provides incremental building. This means that from the moment you spin up the server, they will watch for changes and only rebuild the pages that have changed.
This greatly speeds up build time in a development environment for both generators.
A Clear Winner
Given that most sites aren’t going to be anywhere close to 10,000 posts, we’ll make the final verdict based on average build time over 10, 100, and 1,000 posts…
So as we can see, when it comes to speed and build performance, Hugo is a clear winner.
Don’t just take our word for it. Smashing Magazine, reportedly builds their 7,500-page Hugo site in 13 seconds and Hugo user @darinpope managed to generate 600,000 pages in under 5 minutes.
What’s your experience?
Do you run a Jekyll or Hugo site? Share your build times in the conversation on Hacker News.
Next week, we’ll compare the usability and features of Hugo and Jekyll to help you decide which static site generator is right for you.
Caught a mistake or want to contribute to the blog? Edit this page on Github!