willkg / douglas

DEAD PROJECT: File based static rendering blog system
Other
2 stars 3 forks source link

speed up compiling #35

Closed willkg closed 10 years ago

willkg commented 10 years ago

Takes 1m32s to compile my blog which is epically horrible performance.

This issue covers identifying the slow parts and speeding them up.

willkg commented 10 years ago

Seems there was some epic slowness in three places:

  1. parsing entries
  2. walking the directory tree and returning a list of files
  3. rendering the output

The first two were solved with adding memoization to run_callback and memoizing parse_entry_file and _walk_internal.

The second was solved by breaking out jinja environment building and memoizing environments.

Now it takes 24s to render my blog. I've got 800+ entries, so it's possible I could squeeze out some more performance, but it'd require me to rearchitect parts of Douglas to make optimizing easier.

Landed in master in ab04811.