8

I'm using Octopress as my blog engine. It's perfect. But if there are many posts, for example 400+ posts, the speed of generation is soooo slow.

So, is there any way to speed up Jekyll/Octopress generation?

Thanks.

fannheyward
  • 15,632
  • 10
  • 61
  • 99
  • I'd love to know this, too! But I already know what `isolate` and `integrate` does, so hopefully someone will post an answer how to generate only the new stuff with the `generate` command! – musicmatze Dec 07 '12 at 14:52
  • I use Jekyll instead of Octopress, but have come up with a process that helps speed up editing and design changes. The idea is to work on a sub set of files that can generate quickly and only generate the full set just before deployment. The same approach might work for Octopress. You can see my full description of the process here: http://stackoverflow.com/a/14674402/102401 – Alan W. Smith Feb 07 '13 at 11:54

6 Answers6

3

Obviously if you are just working on one post, there is no need to wait for the entire site to generate. What you are looking for is the rake isolate[partial_post_name] task.
Using rake isolate, you can “isolate” only that post you are working on and move all the others to the source/_stash folder. The partial_post_name parameter is just some words in the file name for the post. For example, if I want to isolate the post from the earlier example, I would use

rake isolate[plain-english]  

This will move all the other posts to source/_stash and only keep the 2011-09-29-just-type-the-title-of-the-post-here-in-plain-english.markdown post in source/_posts. You can also do this while you are running rake preview. It will just detect a massive change and only regenerate that one post from then on.

by @Pavan Podila
More Info: Tips for Speeding Up Octopress Site Generation

2013.01.08 update:
Hexo--A fast, simple & powerful blog framework, powered by Node.js.
Features:Incredibly fast - generate static files in a glance

2013.6.20 update:
gor -- A static websites and blog generator engine written in Go
gor has following awesome benefits: 1. Speed -- Less than 1 second when compiling all my near 200 blogs on wendal.net 2. Simple -- Only one single executable file generated after compiling, no other dependence

Snger
  • 1,314
  • 18
  • 23
  • 2
    I think this is only a partially answer on the question. For sure, nothing is wrong what you said, but your answer does not explain how to compile the complete site, without compiling the stuff which is already compiled. I'd love to know this, too! – musicmatze Dec 07 '12 at 14:49
  • @musicmatze hi,you can try to use [hexo](http://zespia.tw/hexo/),A fast, simple & powerful blog framework, powered by Node.js.Incredibly fast - generate static files in a glance. – Snger Jan 08 '13 at 06:41
  • @musicmatze try gor -- A static websites and blog generator engine written in Go.https://github.com/wendal/gor – Snger Jun 20 '13 at 05:21
1

Install Ruby GSL

gem install gsl 

You should notice a speed increase.

Joshua Hornby
  • 273
  • 2
  • 5
  • 18
  • 5
    Can you explain why? What does jekyll use from gsl? – keflavich Dec 30 '12 at 17:21
  • I agree, can you explain? Also this gem install fails. – Chris Hough Nov 24 '13 at 08:02
  • Jekyll's "related posts" uses latent semantic indexing, provided by Classifier::LSI. To do so, it uses vector analysis features, which can be accelerated by (a Ruby wrapper of) GSL, the [GNU Scientific Library](http://www.gnu.org/software/gsl/). If GSL isn't available, a pure-Ruby implementation is used, but it's exceptionally slow for big sites, and using GSL improves performance ~10x. – Jashank Jeremy Jan 02 '14 at 04:03
  • _should_ notice? Do you have reasons why this works? Do I just use `jekyll build` after without extra flags? – dalanmiller Jan 20 '16 at 19:56
1

hexo powered by Node.js. I am using it, much faster than Octopress. And it provides a simple way to migrate your articles to hexo very easily.

Julian
  • 71
  • 1
  • 4
  • hexo is indeed very fast. I switched from DocPad to hexo because of speed: http://stackoverflow.com/questions/17176094/show-only-partial-blog-post-in-docpad-with-read-more-link – hansaplast Jun 06 '14 at 07:39
  • hexo is great, but migration is not for me. Some markdown are not supported. – Jason Oct 04 '15 at 03:47
1

You can generate only one post while you are writing it using

rake isolate[your-post]

and then

rake integrate

to go back to normal.

To fully answer your question, you can't generate only one post. You can see Octopress' Issue #395 on that subject, which explains that this is due to a limitation on Jekyll's side.

alestanis
  • 20,205
  • 4
  • 45
  • 66
0

Reached this post with the same problem, but then did not quite like the idea of rake isolate. Also the inbuilt task does not integrate with the _drafts workflow. So what I ended up using is to create a custom config.yml with the _posts folder excluded (using exclude) and have only the drafts folder built. You can pass in a different config file as command line parameter to jekyll. I just used this when actively writing new posts and while publish use the same old approach (which still does take some time). This approach builds only the draft post and I am good with that.

jekyll build --watch --drafts --config _previewconfig.yml

For those interested in the complete worklow take a look here

Rahul P Nath
  • 184
  • 2
  • 9
0

If your blog has a lot of images (and other static assets that do not change between builds), it is worthwhile to exclude them from Jekyll's build process, and instead manually update them as needed.

For whatever reason, Jekyll build is not intelligent when it comes to handling such assets. It will delete everything in the public folder, and re-copy the contents in source every time you build. This is wasteful if the assets haven't changed. This can be avoided by using a tool such as Robocopy (Windows) or Rsync (Linux) that is able to update only what has changed.

To tell Jekyll to ignore a folder, add the following to _config.yml:

exclude:     # exclude from build
  - folderPath
keep-files:  # do not delete/empty copy in `public`
  - folderPath

Then elsewhere, use whatever tool you want to update the folder.


For more things you can try, see this post.

Jet Blue
  • 4,131
  • 4
  • 28
  • 37