Skip to content

Commit

Permalink
Merge pull request #245 from thephpleague/benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed May 21, 2016
2 parents 182498b + 01b3c0e commit 3426264
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"ext-mbstring": "*"
},
"require-dev": {
"cebe/markdown": "~1.0",
"erusev/parsedown": "~1.0",
"jgm/CommonMark": "0.25",
"michelf/php-markdown": "~1.4",
Expand Down
14 changes: 13 additions & 1 deletion tests/benchmark/benchmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@
$parser = new Parsedown();
$parser->text($markdown);
},
'cebe/markdown' => function ($markdown) {
$parser = new \cebe\markdown\Markdown();
$parser->parse($markdown);
},
'cebe/markdown gfm' => function ($markdown) {
$parser = new \cebe\markdown\GithubMarkdown();
$parser->parse($markdown);
},
'cebe/markdown extra' => function ($markdown) {
$parser = new \cebe\markdown\MarkdownExtra();
$parser->parse($markdown);
},
];

$iterations = 20;
Expand All @@ -54,5 +66,5 @@
printf("Here are the average parsing times:\n", $iterations);
printf("===================================\n");
foreach ($results as $name => $ms) {
printf("%-18s | %4d ms\n", $name, $ms);
printf("%-19s | %4d ms\n", $name, $ms);
}

0 comments on commit 3426264

Please sign in to comment.