cmark

My personal build of CMark ✏️

Commit
05d730a32b47ae3343479b35eb4a1d3448a5fc13
Parent
0655c79138d3115f12b08fb4d38d164c3b8482eb
Author
John MacFarlane <fiddlosopher@gmail.com>
Date

Put benchmarks in separate benchmarks.md file.

Diffstat

2 files changed, 24 insertions, 17 deletions

Status File Name N° Changes Insertions Deletions
Modified README.md 18 1 17
Added benchmarks.md 23 23 0
diff --git a/README.md b/README.md
@@ -13,23 +13,7 @@ The implementations
 The C implementation provides both a shared library (`libcmark`) and a
 standalone program `cmark` that converts CommonMark to HTML.  It is
 written in standard C99 and has no library dependencies.  The parser is
-very fast, on par with [sundown](https://github.com/vmg/sundown).  Some
-benchmarks (on an ancient Thinkpad running Intel Core 2 Duo at 2GHz,
-measured using `time` and parsing a ~500K book, the English version of
-the 1st edition of
-[*Pro Git*](https://github.com/progit/progit/tree/master/en) by Scott
-Chacon):
-
-|Implementation | Time  |  Factor|
-|---------------|-------|--------|
-| Markdown.pl   | 5.162s|   286.8|
-| PHP Markdown  | 1.021s|    56.7|
-| commonmark.js | 0.292s|    16.2|
-| peg-markdown  | 0.279s|    15.5|
-| marked        | 0.239s|    13.3|
-| discount      | 0.090s|     5.0|
-| **cmark**     | 0.020s|     1.1|
-| sundown       | 0.018s|     1.0|
+very fast (see [benchmarks](benchmarks.md)).
 
 It is easy to use `libcmark` in python or ruby code:  see `wrapper.py`
 and `wrapper.rb` in the repository for simple examples.
diff --git a/benchmarks.md b/benchmarks.md
@@ -0,0 +1,23 @@
+# Benchmarks
+
+Some benchmarks, run on an ancient Thinkpad running Intel Core 2 Duo at 2GHz.
+
+|Implementation |  Time (sec)| Factor|
+|---------------|------------|-------|
+| Markdown.pl   | 2921.30    | 14606 |
+| PHP markdown  | 20.475     | 102.4 |
+| peg-markdown  | 5.330      |  26.7 |
+| commonmark.js | 2.730      |  13.6 |
+| marked        | 1.870      |   9.4 |
+| discount      | 1.660      |   8.3 |
+| cmark         | 0.290      |   1.4 |
+| sundown       | 0.200      |   1.0 |
+
+To run these benchmarks, use `make bench PROG=/path/to/program`.
+
+The input text is a 10MB Markdown file built by concatenating 20 copies
+of the Markdown source of the first edition of [*Pro
+Git*](https://github.com/progit/progit/tree/master/en) by Scott Chacon.
+
+`time` is used to measure execution speed.
+