From c360bb0e1767cd89e51a8580c29c2ccfbbd5a0f1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 17 Jan 2015 21:01:39 -0800 Subject: Added new fine-grained JS benchmarks. And a script to run them. --- tools/detailed_benchmarks.sh | 2 ++ tools/format_benchmarks.awk | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100755 tools/detailed_benchmarks.sh create mode 100644 tools/format_benchmarks.awk (limited to 'tools') diff --git a/tools/detailed_benchmarks.sh b/tools/detailed_benchmarks.sh new file mode 100755 index 0000000..8bc76b4 --- /dev/null +++ b/tools/detailed_benchmarks.sh @@ -0,0 +1,2 @@ +sudo echo "" +for x in samples/*.md; do make benchjs BENCHINP=$x; done | awk -f tools/format_benchmarks.awk 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; + } +} -- cgit v1.2.3