Monday, February 01, 2010

reddit has a new rendering engine! (hopefully you didn't notice)

As most of you know, reddit's commenting system uses a technology called Markdown that allows you to type stuff like:
My [site](http://something.com) is *really* cool.
...and have it rendered as:
My site is really cool.
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.

If you happen to be the sort of person who can't resist looking for security holes in any new technology, and you come across one here, please let us know quietly, rather than choosing to announce your finding in the form of a worm which takes out the entire site. DO NOT SHARE YOUR EXPLOIT WITH ANYONE ELSE. I promise that we'll immediately get to work on the problem as soon as you tell us, and once it's fixed, we'll give you full credit ... as well as the special new ultra-rare "White Hat" trophy. We're also retroactively giving it to previous responsible disclosers chromakode and notrael. The aptly-named javascriptinjection, who wrote and accidentally released the aforementioned worm, will get one too, but only because he immediately got in touch with us as soon as he realized what he had done, then later found a second vulnerability and reported that one the nice way. Hats off to our winners!

tl;dr: If you see any wonky comments, tell us.

P.S. Special thanks to David Parsons, who is the author and maintainer of Discount and has just been an all-around great guy with respect to this big change. He patiently and quickly answered my endless stream of questions about his code, and even added features to the library that we would have otherwise had to hack in ourselves as a patch. Check out his website, too; it includes photos of his casemod projects and detailed visual archives of some amateur experiments in the field of recombinant DNA research.
discuss this post on reddit