jgm / jgm/peg-markdown

Slow parsing with inline HTML on 0.4.14

Open
#30 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
709
Forks
139
PR merge metrics
No merged PRs in 30d

Description

Converting a document with a certain amount of inline HTML is very slow. The original document contained way more content than just the `

` tags, thus resulting in even higher conversion time. I stripped it down to just the inline HTML in order to ease reproduction.

I created a [gist](https://gist.github.com/mrreynolds/7319603) for the mentioned document.

``` bash
$ peg-markdown -v
peg-markdown version 0.4.14
Copyright (c) 2008-2009 John MacFarlane. License GPLv2+ or MIT.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ time peg-markdown document.md
[OUTPUT STRIPPED]
real 0m4.217s
user 0m4.202s
sys 0m0.009s
```

Suprisingly, plain old Markdown is pretty fast at converting the document:

``` bash
$ time markdown document.md
[OUTPUT STRIPPED]
real 0m0.049s
user 0m0.042s
sys 0m0.006s
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.