The Stochastic Game

Ramblings of General Geekery

Posts tagged with piecrust

Piecrust 2.0 and Beyond

As is tradition, PieCrust 2.0 was released without much fanfare a few weeks ago. Just like with the previous version, it just happened because, well, nothing happened: I was using PieCrust for a couple other websites without any problem or need for new features, so I figured it might be as good a time as any to make it official.

Time to run pip install -U piecrust.

Read more...

Happy New Year!

Happy new year and other such holiday things to the 3 people who read my blog!

I was in San-Francisco for new year’s eve and it was quite lovely.

Golden Gate

Apart from the sake of posting something new, this post is also to show off how PieCrust’s admin panel can now upload page assets (in this case, that would be the picture above… check the URL, it’s hosted right here). This feature will be part of the impending 2.0 release, but you can get it by pulling the latest from BitBucket or GitHub as usual.

Cheers!


PieCrust 2.0rc2

PieCrust 2.0rc2 was published a couple days ago, and it’s mostly a bug fix and clean-up release, as you might expect. Run your pip install piecrust --pre -U to update, or whatever you do usually. More info after the jump.

Pie

Read more...

Baking faster with hoedown

Update: the times reported by the Bench utility are CPU times, i.e. they represent the time spent working by your various CPUs. The “real/wall” time, i.e. the time you effectively have to wait as a user, is usually a third less than that. So the “real” time for my blog went roughly from 7 seconds to 5 seconds.

In a previous blog post about PieCrust performance, I mentioned how static site generators are dependent on the performance of their formatting and templating libraries. One of the most common formatters are Markdown formatters and, by default, PieCrust uses Python Markdown. It’s the easiest one to install and use, but it’s far from the fastest one.

As far as I know, the fastest one that’s still maintained is Hoedown, for which some Python bindings exist. And if you have a recent enough version of PieCrust, there will be support for a Hoedown formatter, as long as you install Hoedown. You can do that by running pip install hoedown.

Once installed, you can make replace Markdown with Hoedown by writing this in your config.yml, or in a config variant:

site:
    default_format: hoedown
    auto_formats:
        md: hoedown

Any extensions you have declared for the Markdown formatter generally also translate directly to Hoedown:

hoedown:
    extensions: [fenced_code, footnotes, smartypants]

The performance increase can be pretty noticeable. For instance, on my ancient MacBook Pro (2.4GHz Core 2 Duo), this blog takes almost 9 seconds to bake1:

Markdown benchmark

With Hoedown, the time goes down to 7.2 seconds:

Hoedown benchmark

Pretty worth it if you ask me! Now most of the time spent baking happens during templating with Jinja2… time to look for a faster alternative?


  1. I used the Bench tool to generate those reports.