summaryrefslogtreecommitdiff
path: root/tools/format_benchmarks.awk
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-01-17 21:01:39 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-01-17 21:01:39 -0800
commitc360bb0e1767cd89e51a8580c29c2ccfbbd5a0f1 (patch)
treef0cfab15c1d04be5fdaca70233144ec65cc89c08 /tools/format_benchmarks.awk
parent16b275eb7b83ccbea6ef18b1c62efa655a1d3759 (diff)
Added new fine-grained JS benchmarks.
And a script to run them.
Diffstat (limited to 'tools/format_benchmarks.awk')
-rw-r--r--tools/format_benchmarks.awk35
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/format_benchmarks.awk b/tools/format_benchmarks.awk
new file mode 100644
index 0000000..88dd7a3
--- /dev/null
+++ b/tools/format_benchmarks.awk
@@ -0,0 +1,35 @@
+#!/bin/sh env awk
+BEGIN {
+ CONVFMT="%2.1f";
+ print "| Sample |showdown |commonmark|marked |markdown-it|"
+ print "|------------------------|---------:|---------:|---------:|----------:|"
+}
+{
+ if (/samples\//) {
+ sub(/samples\//, "");
+ printf "|%-24s|", $7;
+ } else if (/^showdown/) {
+ sub(/,/, "");
+ showdown = $4;
+ } else if (/^commonmark/) {
+ sub(/,/, "");
+ commonmark = $4;
+ } else if (/^marked/) {
+ sub(/,/, "");
+ marked = $4;
+ } else if (/^markdown-it/) {
+ sub(/,/, "");
+ markdownit = $4;
+ printf "%10s|%10s|%10s|%11s|\n",
+ (showdown / showdown),
+ (commonmark / showdown),
+ (marked / showdown),
+ (markdownit / showdown);
+ markdownit = "";
+ showdown = "";
+ marked = "";
+ commonmark = "";
+ } else {
+ next;
+ }
+}