johannhof / markdown.rs

Rust Markdown parsing library
Apache License 2.0
136 stars 44 forks source link

Massive memory improvements, major performance improvements, breaking API change #52

Closed Phlosioneer closed 1 year ago

Phlosioneer commented 2 years ago

Major improvements to memory usage and parsing speed. Lots of changed files. Superset of commits in #49. Avoids nearly all string allocations, referencing the input string with slices instead. Benchmark pre-pull-request on large markdown file: 3,000,000ns Benchmark after this pull-request: 300,000ns

Breaking API changes, added lifetime parameters to most structures. The Code variant has also been changed to be an array of string slices, instead of a single string. Users will have to concatenate the string slices with newlines.

Fixes a few bugs, including the handling of escaped characters inside of emphasis spans.

Remake of #51 with proper origin branch, so I can continue improvement of my fork.