This Space for Rent

Flattery will get you everywhere (#2 in a series)

We get so many comments (and comment-viewings) per second that doing this translation has always been a major burden on our servers. The more CPU cycles we spend on it, the more application servers we need, and in turn the more connections going to our database servers, the more places we have to roll code out to, and all sorts of other growth problems.

But you shouldn’t feel one ten-thousandth of a guilt unit over this news, because we’ve just switched our rendering engine from markdown.py (which is nothing to sneeze at and has served us well since the beginning) to a 100%-compatible, pure-C implementation of Markdown known as Discount. (Get it?)

In our tests, Discount is fifteen times faster than markdown.py, which should allow us to reclaim some of our computing power and devote it to other areas of the site that are struggling.

–Announcement in the reddit blog this afternoon.

Admittedly, there are still some defects in 1.6.0 (there’s going to be a 1.6.1 coming out in the next day or so (after the reddit userbase has had their chance to find and exploit more of the security holes in my code)) but it’s nice to see some of my programs being useful to people other than myself.

Comments


Well done. It’s preposterous that a) people have forgotten that a compiled C binary is usually much faster than some script b) all these goddamn Web boards have spent so much time badly reimplementing NNTP instead of just putting a shiny frontend to a lean implementation thereof.

rone Tue Feb 2 18:02:47 2010

The webpage for discount lists two (incompatible?) ways of marking a blockquote as being a div instead:

A blockquote with a first line of > %class% will become <div class="class"> instead of a <blockquote>.

and

>%class:A%
this is a class A div block

%class:B%
this is a class B div block

properly generates

<div class="A"><p>this is a class A div block</p></div>

<div class="B"><p>this is a class B div block</p></div>”

Neither worked in my testing.

Am I missing something? Is there some command line switch that turns this feature on? Or is this an old feature that got cut?

Carl Tue Feb 2 18:43:11 2010

As of right now, it’s not configurable at runtime (I made the bad design decision to have it be a configuration option) so you’ll have to enable it when you run configure.sh:

configure.sh --enable-div {all the other enable options you want}

and then it will just work no matter what.

%class:class% is the long version of %class%; there’s also %id:class% for additional css hilarity.

David Parsons Tue Feb 2 19:19:27 2010

Ah. I actually looked at the source and saw the #IF statement around the div code and thought, “Huh? Is this a compile-time option or something?… Nah, why would anyone do something crazy like that. I just must not understand C very well.”

I guess I should gone with my gut! :-)

Carl Tue Feb 2 20:00:52 2010

Comments are closed