We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#render_html
#render_doc.to_html
Not sure if it's commonmarker or underlying lib issue, but still. Highly scientific benchmark
Benchmark.ips do |x| 10.times do |n| x.report("commonmarker_render_html #{n}") do CommonMarker.render_html(text, :DEFAULT, [:autolink]) end x.report("commonmarker_two_step #{n}") do parsed_doc = CommonMarker.render_doc(text, :DEFAULT, [:autolink]) parsed_doc.to_html(:DEFAULT, [:autolink]) end end x.compare! end
where text is README.md from this repo shows
text
README.md
Comparison: commonmarker_two_step 7: 6766.2 i/s commonmarker_two_step 2: 6753.3 i/s - same-ish: difference falls within error commonmarker_two_step 8: 6748.9 i/s - same-ish: difference falls within error commonmarker_two_step 5: 6725.9 i/s - same-ish: difference falls within error commonmarker_two_step 6: 6720.3 i/s - same-ish: difference falls within error commonmarker_two_step 1: 6720.3 i/s - same-ish: difference falls within error commonmarker_two_step 4: 6705.3 i/s - same-ish: difference falls within error commonmarker_two_step 0: 6703.2 i/s - same-ish: difference falls within error commonmarker_two_step 9: 6664.8 i/s - same-ish: difference falls within error commonmarker_two_step 3: 6655.7 i/s - same-ish: difference falls within error commonmarker_render_html 8: 2542.5 i/s - 2.66x (± 0.00) slower commonmarker_render_html 7: 2519.9 i/s - 2.69x (± 0.00) slower commonmarker_render_html 3: 2498.4 i/s - 2.71x (± 0.00) slower commonmarker_render_html 0: 2492.0 i/s - 2.72x (± 0.00) slower commonmarker_render_html 9: 2453.8 i/s - 2.76x (± 0.00) slower commonmarker_render_html 2: 2429.4 i/s - 2.79x (± 0.00) slower commonmarker_render_html 4: 2412.7 i/s - 2.80x (± 0.00) slower commonmarker_render_html 6: 2391.4 i/s - 2.83x (± 0.00) slower commonmarker_render_html 5: 2371.8 i/s - 2.85x (± 0.00) slower commonmarker_render_html 1: 2363.0 i/s - 2.86x (± 0.00) slower
so we can easily speedup #render_html 2.5x times by using some more ruby, but I have a suspicion that it should be faster as is.
The text was updated successfully, but these errors were encountered:
Rework rb_markdown_to_html
1d5032d
Fixes gjtorikian#141
de2511d
e2aef8c
Merge pull request #171 from ojab/lil_speedup
722a3d1
Fixup benchmark and speedup a little, fixes #141
No branches or pull requests
Not sure if it's commonmarker or underlying lib issue, but still.
Highly scientific benchmark
where
text
isREADME.md
from this repo showsso we can easily speedup
#render_html
2.5x times by using some more ruby, but I have a suspicion that it should be faster as is.The text was updated successfully, but these errors were encountered: