Giter VIP home page Giter VIP logo

markbench's Introduction

Markdown Benchmarks (PHP)

Build Status Latest Stable Version SensioLabsInsight

All parsers are managed by composer (minimum-stability=stable). Tested with latest stable version.

See the latest benchmark on Travis-CI

$ php bin/markbench benchmark --profile=github-sample
Runtime: PHP5.5.9
Host:    Linux testing-worker-linux-9-1-25355-linux-14-19501860 2.6.32-042stab079.5 #1 SMP Fri Aug 2 17:16:15 MSK 2013 x86_64
Profile: Sample content from Github (http://github.github.com/github-flavored-markdown/sample_content.html) / 1000 times
Class:   Markbench\Profile\GithubSampleProfile

+----------------------+---------+---------+---------------+----------+--------------+
| package              | version | dialect | duration (MS) | MEM (B)  | PEAK MEM (B) |
+----------------------+---------+---------+---------------+----------+--------------+
| erusev/parsedown     | 0.9.4   |         | 4183          | 9437184  | 9437184      |
| cebe/markdown        | 0.9.2   |         | 5081          | 9437184  | 9699328      |
| cebe/markdown        | 0.9.2   | gfm     | 6293          | 9437184  | 9699328      |
| michelf/php-markdown | 1.4.0   |         | 15568         | 9699328  | 9699328      |
| michelf/php-markdown | 1.4.0   | extra   | 23401         | 9699328  | 9961472      |
| kzykhys/ciconia      | v1.0.3  |         | 32115         | 10747904 | 11010048     |
| kzykhys/ciconia      | v1.0.3  | gfm     | 39654         | 10747904 | 11010048     |
+----------------------+---------+---------+---------------+----------+--------------+

Tested parsers

Internals

Each parser is executed asynchronously using kzykhys/Parallel.php

Runner
 +-->(kzykhys/Parallel.php)
        +-- child process #1 --+
        +-- child process #2 --+--> output
        +-- child process #3 --+
        |-- duration/mem usage --|

Requirements

  • PHP5.4+
  • Compiled with --enable-pcntl

Add a parser

  • Put your class that implements Markbench\DriverInterface into Driver directory.
  • Run command again

Feel free to fork and send a pull request!

Run a benchmark

composer install
bin/markbench benchmark
$ bin/markbench help benchmark
Usage:
 benchmark [--parser="..."] [-p|--profile[="..."]]

Options:
 --parser              Name of a parser. Available: cebe/markdown, cebe/markdown:gfm, kzykhys/ciconia, kzykhys/ciconia:gfm, erusev/parsedown, michelf/php-markdown, michelf/php-markdown:extra
 --profile (-p)        Name of a profile. (default: "default")
 --help (-h)           Display this help message.
 --quiet (-q)          Do not output any message.
 --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
 --version (-V)        Display this application version.
 --ansi                Force ANSI output.
 --no-ansi             Disable ANSI output.
 --no-interaction (-n) Do not ask any interactive question.

Profiles

  • default
  • blank
  • github-sample

Add a profile

  • Put your class that implements Markbench\ProfileInterface into Profile directory.
  • Run php bin/markbench benchmark --profile=your_profile_name

Feel free to fork and send a pull request!

License

The MIT License

Author

Kazuyuki Hayashi (@kzykhys)

markbench's People

Contributors

cebe avatar hkdobrev avatar kzykhys 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.