March 27, 2014

Speeding up Jekyll's Latent Semantic Mapping on OS X

Running Jekyll with Latent Semantic Indexing (or LSI) on a site of only 20-30 pages can take 5-10 minutes on a reasonably powerful Mac. I got tired of having to wait or isolate individual posts to get on with writing, so I took Jekyll’s recommendation and installed the GNU Scientific Library (or GSL).

After properly installing GSL on my MacBook Pro, building my site went from over 5 minutes for a site with about 100 posts, to under 5 seconds.


  • You’re using (or want to use) Jekyll’s LSI and related posts function
  • Xcode (and most likely the command-line tools)
  • Homebrew
  • Ruby, RubyGems and Bundler


  1. Install GSL via homebrew:

     $ brew install gsl
  2. If you don’t already have a Gemfile for your Jekyll site, create one that looks similar to this:

     source ''
     gem 'jekyll'
     gem 'gsl'

    Note: If you already have a Gemfile, the important lines are narray and gsl. Be sure to include the git repository links, as these contain my fixes to compile on OS X 10.9 “Mavericks”.

  3. Now use Bundler to install the dependencies on your Mac:

     $ cd {YOUR SITE'S FOLDER}
     $ bundle install

    Note: It’s probably worth while looking into a tool like RVM, rbenv or similar that will let you create gemsets so that you don’t pollute the system rubygems unnecessarily.

  4. Now start up Jekyll and activate LSI (add --watch if you want to rebuild on any change to your content):

     $ jekyll serve --lsi
  5. Make yourself a coffee with all the extra time you’re going to save not sitting around waiting for the LSI indexer to finish!

Et voilà! Super speedy site rebuilds with more intelligent related posts for each page.