nim-markdown icon indicating copy to clipboard operation
nim-markdown copied to clipboard

Improve the Performance of nim-markdown

Open soasme opened this issue 3 years ago • 1 comments

This is an umbrella issue for tracking the efforts on improving the performance of nim-markdown.

Below are potential bottlenecks:

  • [ ] Use normal sequence, instead of doublylinkedlist for token sequence.
  • [x] HtmlBlockParser.parse is very slow. It has nested loop runs which can be optimized. #52
  • [x] Consume less memory/gc by assigning slices instead of string objects to tokens. #54, #55, #56
  • [ ] Pre-chop the string by lines, instead of ad-hoc splitLines.
  • [ ] Use kind: XXX, instead of object inheritance.
  • [ ] Ignore parsing content when an html comment is matched.
  • [x] remove bottleneck since() calls. #53
  • [x] remove bottleneck firstLine() & restLines() calls. #56

soasme avatar Mar 12 '21 05:03 soasme

minor point related to #49: in the specific case of parsing html comments (<!-- ... -->), there is no need to parse the content inside (which I think it is currently happening).

pietroppeter avatar Mar 12 '21 10:03 pietroppeter