~mht/cmr

05920ea3b5d1b2470c455bd87f7525e880ba2400 — Martin Hafskjold Thoresen 3 years ago 2476330
Add plot generating scripts and some data
A experimental-data/Makefile => experimental-data/Makefile +13 -0
@@ 0,0 1,13 @@
%.data: %.output bench-to-cols.py
	./bench-to-cols.py < $< > $@

hm80-t72.pdf: hm80-t72.data 
	./boxplot.sh hm80-t72.data hm80-t72.pdf "80/10/10, t=72"

%.pdf: %.data
	./boxplot.sh $< $*.pdf "lol"

.PHONY: clean
clean:
	rm -f *.output *.pdf


A experimental-data/bench-to-cols.py => experimental-data/bench-to-cols.py +37 -0
@@ 0,0 1,37 @@
#!/usr/bin/python

# This program transforms the output of the benchmark suite
#       80      cmr::HashMap    80-10-10        15,130,383 ops/sec
#       80      std::HashMap    80-10-10        1,451,166 ops/sec
#       80      cb::HashMap     80-10-10        13,969,566 ops/sec
#       80      cbo::HashMap    80-10-10        15,289,533 ops/sec
# to column wise order where one column is one kind (cmr, std, cb, or cbo),
# and each row is one data point.
#       # cmr std cb cbo
#       15130383 1451166 13969566 15289533 
#       ....
#
# Data is read from `stdin`, and output is written to stdout.

import sys

values = {}

for line in sys.stdin.readlines():
    split = line.split()
    kind = split[1].split('::')[0]
    ops = split[3].replace(',', '')
    if kind not in values:
        values[kind] = []
    values[kind].append(ops)

# Assert that all kinds have the same number of data points
assert(len(set(map(lambda l: len(l), values.items()))) == 1)

z = zip(*values.items())
kinds = z[0]
print('\t'.join(kinds))
nums = zip(*z[1])

for nums in zip(*z[1]):
    print('\t'.join(list(nums)))

A experimental-data/boxplot.sh => experimental-data/boxplot.sh +27 -0
@@ 0,0 1,27 @@
#!/bin/bash

IN_FILE="$1"
OUT_FILE="$2"
TITLE="$3"

gnuplot <<< "\
set terminal pdf size 13cm,8cm
set termoption font \"Linux Libertine,20\"
set output '$OUT_FILE'

set style fill solid 0.25 border -1
set style boxplot outliers pointtype 7
set style data boxplot
set pointsize 0.5
set key autotitle columnhead
set title '$TITLE'

stats '$IN_FILE' skip 1 nooutput
n = STATS_columns

header = system('head -n1 $IN_FILE')
set xtics ()
set for [i=1:n] xtics add (word(header, i) i)

plot for [i=1:n] '$IN_FILE' using (i):i notitle
"

A experimental-data/hm80-t72.data => experimental-data/hm80-t72.data +101 -0
@@ 0,0 1,101 @@
std	cb	cmr	cbo
1646383	13592616	16407000	14132683
1576250	15470833	16663666	15121533
1572866	14150200	17450800	14047250
1557933	16474850	16936983	15546033
1606600	15057816	16263383	16235100
1525900	12881766	16934250	13557916
1604666	13232566	16673133	14484366
1477166	13678500	15862483	13643700
1619950	14821583	17314533	14698050
1593933	13095950	15124083	14644100
1598966	16896016	16962150	13260183
1561433	13162700	17561516	14774650
1673650	13253800	16828300	17041283
1515966	13807866	17419283	13878066
1597700	14188683	16537166	16475300
1426350	14946283	16376450	14160800
1541166	16002983	16695900	14574283
1570666	13998200	15947766	14446866
1387516	13757916	18799033	15863583
1552566	13532633	16676183	15666583
1535083	13241383	15886916	13674516
1331866	15414883	17818666	16127233
1606783	15105866	17008166	13712283
1570733	14188083	16502116	15563300
1541733	13941900	17617183	14043466
1679900	14508883	19251750	16291200
1556666	15812483	18955700	16880883
1664833	15015133	19325050	18202216
1700316	17854250	20902750	17070916
1659583	16557166	19054183	16245716
1669733	16239766	17047933	18115833
1529000	15500550	19398400	17022666
1577566	13882683	19588166	14977383
1582450	15656150	20075733	18316050
1633433	16033750	18603666	13228633
1575116	15693033	19115883	17915900
1629650	16651350	20267666	14644533
1626300	16457450	19462450	17545300
1535616	17186800	19968866	15332116
1592016	16460533	19299966	15914933
1638533	14948050	16392216	16198783
1600616	13492550	17264166	16407183
1545916	16251450	19799316	15604166
1655116	13942750	18189350	17494800
1606916	15437083	19536066	15880350
1613883	17395566	19914583	15186916
1634566	17177466	19243683	17031000
1603633	18576033	20699500	16424133
1570550	17451633	19958966	15624183
1574300	15983483	19890616	16973483
1548950	15895700	17868600	15367350
1598850	16394733	18863600	16146600
1591750	14230250	19274450	16409000
1600450	13946533	21411566	15951100
1651850	14560066	19892500	15359066
1601850	16503150	19756066	18911066
1593600	14362866	19789083	15874300
1575616	18389833	20733933	13736433
1623300	15231266	20088133	16100150
1586200	14403650	20469050	15607033
1668050	16587383	18023250	16460500
1657100	15928766	19148366	16468133
1604266	15169583	19347000	16618033
1626000	16611300	19697116	16157833
1644716	18635116	19154716	15213483
1656533	14411683	19289966	17157800
1698000	16394400	19518300	15161533
1583900	15602200	19021316	18366683
1646150	15661433	20537750	14813733
1607733	15681950	15276733	15095966
1637716	16588933	17470666	18968716
1571883	15181300	16704350	14669400
1545300	19038116	19000183	16815500
1571766	17742766	19656700	15107433
1651816	15967150	19293833	17942516
1647716	15888666	20836466	15081950
1518566	13873000	20291716	17521850
1536433	14824083	19987583	15843850
1610633	14963050	19824316	16262133
1522683	18459733	20613516	14910816
1613550	18515200	19829166	17304116
1510016	15168016	19624250	18072666
1568483	17023100	17011600	15731333
1599366	15630233	16517533	15625533
1581816	16126333	19401300	16766083
1537866	14694516	19589066	15290816
1500233	18246483	19515416	14689733
1569550	13869616	20256566	16923716
1534133	16808833	19233933	15538083
1608466	16221366	18627716	15869933
1583883	15259483	18915483	17593366
1618800	17250750	18413000	18078250
1579866	17298183	18806700	15260016
1564650	14345766	19778900	16486966
1586333	16844250	19350533	14112083
1692650	13715316	18839183	15618750
1658800	13925583	19038483	16053016
1603350	18594783	20061200	15306100
1536783	15325766	16779600	20019983
1698866	18258033	20227966	15720550