greghendershott/markdown — pull request #44 by stchang (2014-07-10 16:49:34+00:00)
Title: add <or> profiling option

Here's my quick and dirty `` profiler.

Here's a sample output with `OR-DEBUG` = `#t`:

```
~/racket/markdown-stchang/markdown$ racket
Welcome to Racket v6.0.1.13.
-> (require "parse.rkt")
-> (let ([s (file->string "test/test.md")])
(let ([doc (string-join (for/list ([i 5]) s) "\n\n")])
(time (void (parse-markdown doc)))))
40: (enclosed (string **) (try (string **)) $inline)
15: (enclosed (string __) (try (string __)) $inline)

60: (emph _)
10: (emph *)

40: $link/reference
16: $link/explicit

30: $bullet-list
20: $ordered-list

231: (many1 $blank-line)
0: (lookAhead $html/block)

145: $bullet-list-start
100: $ordered-list-start

820: $anyChar
0: $html-comment

157: (many1 (noneOf (rkt:string open close)))
0: (pdo (xs <- (inner open close)) (return (append (list open) xs (list close))))

21: (try (>>= (chars-in-balanced ( )) (curry parse-from-string $_source+title)))
0: (pdo (>>= (pdo (xs <- (enclosed (char () (char )) $anyChar)) (return (list->string xs))) (curry parse-from-string $_source+title)))

21: (source-url
)
0: (try (pdo (char <) (xs <- (source-url >
)) (char >) (return xs)))

563: (noneOf (string-append excludes))

10: $space-char
0: $newline

231: $para
85: $plain
50: $list
20: $heading
20: $hr
15: (unless-strict $footnote-def)
15: (unless-strict $verbatim/fenced)
11: $blockquote
10: $html/block
10: $reference
6: $verbatim/indent
5: (unless-strict $image/block)

21: (try $indented-line)
0: (try (pdo (bs <- (many (pdo $blank-line (return )))) (i <- $indented-line) (return (string-join (quasiquote ((unquote-splicing bs) (unquote i)))
))))

166: (string )
0: (string	)

5: (image/explicit #t)
0: (image/reference #t)

50: $inline
0: $trailing-hashes-before-newline

3466: $str
2702: $whitespace
421: $special
146: $end-line
95: (unless-strict $smart-punctuation)
90: $code
70: $emph
56: (parse-unless ignore-inline-links? $link)
45: $strong
25: (unless-strict $footnote-ref)
20: (parse-unless ignore-inline-links? $autolink)
10: $html/inline
6: $entity
0: $image/inline
0: ( (4+ *) (4+ _))

...
```