Question

I'm using nanoc to generate documentation for my project. I have several files (~50) and layouts already created but currently I'm working on a single file. Strange thing is that it compiles this one file in less than second and than working on something what takes more than 20 seconds!

Loading site data…
Compiling site…
      update  [0.71s]  output/docs/js/getData/index.html

Site compiled in 22.96s.

When I abort the process after:

      update  [0.71s]  output/docs/js/getData/index.html

line with CTRL+C and the nanoc view my file is compiled well. Do you have any idea how to speed up the process? What nanoc is doing for 20 seconds?

Was it helpful?

Solution

By default, nanoc only shows files that are created, updated or deleted. Files that are recompiled but turn out to be identical will not be shown. If you pass --verbose to nanoc compile, you will see which files are compiled but identical.

So, those 20 seconds where nanoc seems to be doing nothing are likely 20 seconds where nanoc is busy recompiling, but finding that the compiled files are the same, so they’re not shown.

Items will be recompiled unless nanoc can be sure that they will remain identical. Occasionally, nanoc cannot know with certainty that a file will be identical when recompiled, so in this case the item will be recompiled anyway.

23 seconds to compile a site with 50 pages seems slow though. It helps to pick fast filters (e.g., RDiscount for Markdown, pygments.rb for syntax coloring). If you can, run nanoc through a Ruby profiler (e.g., perftools.rb) to find out where the slowness is coming from.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top