Skip to content

Commit d2057cf

Browse files
author
Dan Lecocq
committed
Added support for gnuplot.
1 parent 7421070 commit d2057cf

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ test
44
*.dSYM
55
*.cpp
66
bench
7-
data/*
7+
data/*
8+
*.png
9+
*.dat

Makefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ bench: include/*.hpp bench.cpp data/distinct_1
1616
$(CPP) $(CPPOPTS) bench.cpp -o bench
1717
./bench ./data/distinct_1 | tee -a bench.dat
1818

19+
bench.dat: bench
20+
21+
plot: bench.dat
22+
gnuplot bench.gnuplot
23+
1924
test: include/*.hpp test.cpp
2025
$(CPP) $(CPPOPTS) -Ideps/Catch/single_include test.cpp -o test
2126

2227
clean:
23-
rm -rdf *.o test bench *.dSYM
28+
rm -rdf *.o test bench bench.dat *.png *.dSYM

bench.gnuplot

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
set terminal png
2+
3+
set output "insert.png"
4+
set title "Insertion Time"
5+
set log xy
6+
set yrange [1:10000]
7+
set xrange [10:95000]
8+
set xlabel "Items Inserted"
9+
set ylabel "Ticks To Insert (Best of 10 Consecutive Runs)"
10+
plot 'bench.dat' using 1:2 with lines title 'array-hash', \
11+
'bench.dat' using 1:5 with lines title 'std::map', \
12+
'bench.dat' using 1:8 with lines title 'std::tr1::unordered_map'
13+
14+
set output "query.png"
15+
set title "Query Time"
16+
set log xy
17+
set yrange [1:10000]
18+
set xrange [10:95000]
19+
set xlabel "Items Queried and Contained"
20+
set ylabel "Ticks To Query (Best of 10 Consecutive Runs)"
21+
plot 'bench.dat' using 1:3 with lines title 'array-hash', \
22+
'bench.dat' using 1:6 with lines title 'std::map', \
23+
'bench.dat' using 1:9 with lines title 'std::tr1::unordered_map'
24+
25+
set output "random.png"
26+
set title "Random Query Time"
27+
set log xy
28+
set yrange [1:10000]
29+
set xrange [10:95000]
30+
set xlabel "Items Queried and Contained"
31+
set ylabel "Ticks To Query (Best of 10 Consecutive Runs)"
32+
plot 'bench.dat' using 1:4 with lines title 'array-hash', \
33+
'bench.dat' using 1:7 with lines title 'std::map', \
34+
'bench.dat' using 1:10 with lines title 'std::tr1::unordered_map'

0 commit comments

Comments
 (0)