GithubHelp home page GithubHelp logo

common-mark-benchmarks's Introduction

Benchmarks for JS/Wasm Common Mark (markdown) Implementations

This benchmark suite compares the performance of markdown-to-HTML conversion of the following libraries:

Running the Benchmarks

First, make sure that the submodules are initialized:

git submodule update --init

Next, ensure that the dependencies are installed:

npm install

Build the benchmarks:

npm run build

Now you're ready to run the benchmarks! They can be run in either a Web browser or in Node.js.

In a Web Browser

To start a local server for the benchmarks, run this command:

npm run serve

This will also open the benchmarks Web page in your default browser. After running the benchmarks in that Web page, you will have the option to copy the raw data as CSV.

In Node.js

To run the benchmarks in Node.js and write their raw results to a local CSV file, run this command:

npm run bench

Plotting Results

TODO

Input Corpus

Inputs Adopted from Other Markdown Benchmarks

  • The markdown-it benchmark suite. This suite has also been adopted by commonmark.js. It consists of mostly small, synthetic snippets of markdown, not markdown source files taken from the wild.

  • The Common Mark specification. The Common Mark specification is itself written in markdown. This is a real, non-synthetic markdown file from the wild and is also of a non-trivial input size.

  • Pro Git by Scott Chacon. The commonmark.js project timed their implementation on the concatenated source files of this book, which is written in markdown. We adopt it here.

Additional Inputs

  • HTML entities. Common mark requires normalizing HTML entities into their unicode represenation. This behavior is not particularly well-exercised by existing benchmark inputs, so we add a synthetic benchmark to stress it.

  • README.md files from popular JavaScript projects. We visited each of the repositories listed in GitHub's fontend JavaScript frameworks section of their explore page and collected the README.md files (if present) from each of them. We were concerned that most existing benchmarks' inputs were both synthetic and small. By adding these we intend to round out the corpus with more real world inputs.

common-mark-benchmarks's People

Contributors

fitzgen avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.