Markdown 1.0.2b4 Performance Drop

Allan Odgaard 29mtuz102 at
Sun Jul 30 21:34:21 EDT 2006

On 30/7/2006, at 22:34, Michel Fortin wrote:

>> [...] With the new version this has increased to almost 30 seconds.


> That's probably due to the new HTML block parser. It's clear that

> iterating through all tags to balance them properly takes more time

> than matching a regular expression based mostly on line

> indentation. [...]

I would however think this is a performance bug. 30 seconds for 3,000
lines is 100 lines/second or 26 million cycles spent per line.

For reference I wrote a simple Ruby HTML parser which pushed and
popped the tags to/from a stack, and it took less than a second to
parse the full document.

More information about the Markdown-Discuss mailing list