From 56913be6bb57f81dbbf7baf9cc9a0a2cd1a36493 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Tue, 9 Dec 2014 16:01:56 -0800 Subject: Removed obsolete benchmarks/ and examples/ directories. --- benchmarks/getgraphs.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 benchmarks/getgraphs.py (limited to 'benchmarks/getgraphs.py') diff --git a/benchmarks/getgraphs.py b/benchmarks/getgraphs.py deleted file mode 100644 index aacf6b2..0000000 --- a/benchmarks/getgraphs.py +++ /dev/null @@ -1,35 +0,0 @@ - -import sys - -benchmarks = {} -color_map = {'proto2_compiled': 'FF0000', - 'proto2_table': 'FF00FF', - 'upb_table_byref': '0000FF', - 'upb_table_byval': '00FF00'} -for line in sys.stdin: - name, val = line.split(': ') - components = name.split('_') - benchmark = '_'.join(components[1:3]) - variant = '_'.join(components[3:]) - if benchmark not in benchmarks: - benchmarks[benchmark] = [] - benchmarks[benchmark].append((variant, int(val))) - -def encode(x): - digits = (range(ord("A"), ord("Z")+1) + range(ord("a"), ord("z")+1) + - range(ord("0"), ord("9")+1) + [ord("."), ord("-")]) - return chr(digits[x / 64]) + chr(digits[x % 64]) - -for benchmark, values in benchmarks.items(): - def cmp(a, b): - return b[1] - a[1] - values.sort(cmp) - variants = [x[0] for x in values] - values = [x[1] for x in values] - scaling = 400 - encoded_values = [encode((x * 4096 / scaling) - 1) for x in values] - legend = "chdl=%s" % ("|".join(variants)) - colors = "chco=%s" % ("|".join([color_map[x] for x in variants])) - data = "chd=e:%s" % ("".join(encoded_values)) - url = "http://chart.apis.google.com/chart?cht=bhs&chs=500x200&chtt=%s+(MB/s)&chxt=x&chxr=0,0,%d&%s" % (benchmark, scaling, "&".join([legend, data, colors])) - print url -- cgit v1.2.3