Jekyll is a static site generator that use Ruby as programming language. Because of my curiosity about Jekyll build time performance with JRuby, I want to validate my hypothesis that JRuby will make Jekyll build time faster than Ruby MRI (Matz’s Ruby Intepreter) / Official implementation.

Environments

  • Vagrant 2.2.0
  • Virtual Box 5.2.20
  • Vagrant Operating System: Ubuntu 16.04
  • Vagrant RAM: 2GB
  • Vagrant CPU: 2
  • Both MRI and JRuby are installed with RVM.

List of Ruby Gems

List of my all Ruby Gems on Gemfile:

# frozen_string_literal: true
source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem 'jekyll', '3.8.5'

group :jekyll_plugins do
  gem 'jekyll-sitemap', '1.2.0'
  gem 'jekyll-seo-tag', '2.5.0'
  gem 'jekyll-paginate-v2', '2.0.0'
end

How Do I Run The Test?

  1. Run Jekyll Clean

    jekyll clean
    
  2. Run Jekyll Build with production environment

    JEKYLL_ENV=production bundle exec jekyll build
    
    # example output
    Configuration file: /vagrant/www.example.com/_config.yml
                Source: /vagrant/www.example.com
           Destination: /vagrant/www.example.com/_site
     Incremental build: disabled. Enable with --incremental
          Generating...
             AutoPages: Generating tags pages
             AutoPages: Generating categories pages
             AutoPages: Generating collections pages
            Pagination: Complete, processed 91 pagination page(s)
                        done in 110.613 seconds.
     Auto-regeneration: disabled. Use --watch to enable.
    

Result

Ruby Version Build Time (seconds)
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] 112.241
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux] 114.833
ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-linux] 110.613
jruby 9.2.5.0 (2.5.0) 2018-12-06 6d5a228 OpenJDK 64-Bit Server VM 25.191-b12 on 1.8.0_191-8u191-b12-2ubuntu0.16.04.1-b12 +jit [linux-x86_64] 173.476

Conclusions

  • In my case Ruby MRI is faster than JRuby.
  • Ruby MRI 2.5 & 2.6 almost give similar performance.
  • I think my Jekyll site is better to use Ruby MRI. Not only because it’s give better build time performance, but also some of Jekyll plugins that I want to use does not work well with JRuby.