diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-09 18:27:38 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-09 18:27:38 +0200 |
| commit | de8fd9328e9deb0d1ec596d7486686ea3cb688c2 (patch) | |
| tree | 9c25d7568dee522c1d2ed7b6d238d1dad54163f6 /lib/cmark/bench/stats.py | |
| parent | 661ddc244793102ee0720871c4edcd64f80bc744 (diff) | |
| download | kristall-de8fd9328e9deb0d1ec596d7486686ea3cb688c2.tar.gz | |
Includes cmark markdown parser library.
Diffstat (limited to 'lib/cmark/bench/stats.py')
| -rw-r--r-- | lib/cmark/bench/stats.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/cmark/bench/stats.py b/lib/cmark/bench/stats.py new file mode 100644 index 0000000..c244b41 --- /dev/null +++ b/lib/cmark/bench/stats.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 + +import sys +import statistics + +def pairs(l, n): + return zip(*[l[i::n] for i in range(n)]) + +# data comes in pairs: +# n - time for running the program with no input +# m - time for running it with the benchmark input +# we measure (m - n) + +values = [ float(y) - float(x) for (x,y) in pairs(sys.stdin.readlines(),2)] + +print("mean = %.4f, median = %.4f, stdev = %.4f" % + (statistics.mean(values), statistics.median(values), + statistics.stdev(values))) + |
