需要足够长的&用于性能测试的复杂 Markdown 文档

发布于 2024-08-20 22:38:32 字数 222 浏览 7 评论 0原文

我正在寻找一个又长又复杂的 Markdown 文档,我可以用它来测试不同 Markdown 实现的性能——作为简单文档的迭代基准测试的替代方案。

我想我也许可以浏览 Stack Overflow 并找到一些东西,但总的来说,我找到的所有内容都写得很简单;到目前为止,我在谷歌上还没有找到任何有用的东西。

是否有一个现有文档展示了大部分或全部 Markdown 语法,也许只是为了这样的测试而编写的?

I'm looking for a long and complex Markdown document that I can use to test performance of different markdown implementations -- as an alternative to iterative benchmarking of a simple document.

I thought I might be able to browse around Stack Overflow and find something, but by and large everything I find is pretty simply written; and so far I'm not finding anything useful on Google.

Is there an existing document that showcases most or all Markdown syntax, perhaps written for just such a test?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

瀟灑尐姊 2024-08-27 22:38:32

您是否看过/使用过John Gruber 的测试套件

Have you looked at/used John Gruber's test suite?

浸婚纱 2024-08-27 22:38:32

尝试一下这个。这是 John Gruber 的 Markdown 语法 页面的源 Markdown。

请注意,其中还有一些 HTML。

事实上,如果您将 .text 附加到 John Gruber 网站 上,几乎所有页面都会给您降价。网址。

Try this out. It's the source markdown of John Gruber's Markdown Syntax page.

Be aware that there is some HTML in there as well.

In fact, nearly all pages on John Gruber's site give you markdown if you append .text to the URL.

等风来 2024-08-27 22:38:32

当 Commonmark 退出隐身模式时,Markdown 测试套件死掉后(从而浪费了大量的开放资源)源工作时间...),我在 https://github.com/cirosantilli/commonmark-implementation-compare

速度测试很幼稚,但给出了一个想法:

blackfriday     2.1222s  235  46%
cmark           1.9516s    1   0%
commonmarkjs   37.4651s    2   0%
hoedown         1.8875s  221  43%
kramdown       94.6460s  247  48%
markdown2      28.9707s  278  54%
markdown_pl    14.6919s  287  56%
markdownjs     40.3337s  302  59%
marked         35.3758s  258  50%
maruku         87.1664s  316  61%
multimarkdown   2.0579s  239  46%
pandoc          6.3442s  268  52%
peg_markdown    2.6402s  211  41%
rdiscount      42.0547s  200  39%
redcarpet      43.6608s  229  44%
showdown       45.0655s  285  55%

可能最大的缺陷是每个测试的输入都是从标准输入馈送的,因此调用解释器每次都会承受很大的开销。

原始答案

一种可能是使用 Markdown 测试套件:https://github。 com/karlcow/markdown-testsuite

执行 ./cat-all.py,然后在 all.tmp.md 上运行测试

目前包含 103 个测试,并且已经支持许多 Markdown 引擎。

已经针对各个测试的总时间(也是一个有意义的参数)完成了简单的基准测试,并且针对 cat-all.py 的输出实现它非常容易。

After Markdown Test Suite died when Commonmark came out of stealth mode (thus wasting large amounts of open source work time...), I forked the multi-implementation comparison part (mostly written by yours truly) at https://github.com/cirosantilli/commonmark-implementation-compare

The speed testing is naive, but gives an idea:

blackfriday     2.1222s  235  46%
cmark           1.9516s    1   0%
commonmarkjs   37.4651s    2   0%
hoedown         1.8875s  221  43%
kramdown       94.6460s  247  48%
markdown2      28.9707s  278  54%
markdown_pl    14.6919s  287  56%
markdownjs     40.3337s  302  59%
marked         35.3758s  258  50%
maruku         87.1664s  316  61%
multimarkdown   2.0579s  239  46%
pandoc          6.3442s  268  52%
peg_markdown    2.6402s  211  41%
rdiscount      42.0547s  200  39%
redcarpet      43.6608s  229  44%
showdown       45.0655s  285  55%

Likely the greatest flaw is that each tested input is fed from stdin, so interpreters are called each time, and suffer a large overhead.

Original answer

A possibility is using the Markdown Test Suite: https://github.com/karlcow/markdown-testsuite

Do ./cat-all.py and then run your tests on all.tmp.md

It currently contains 103 tests, and already supports many markdown engines.

Simple benchmarks are already done for the total time of individual tests (also a meaningful parameter), and it would be really easy to implement it for the output of cat-all.py.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文