Skip to content

Commit b7318fb

Browse files
committed
bst_vst_heap_vs_hashmap: make graph beautiful
1 parent 3fdd83c commit b7318fb

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

bst-vs-heap-vs-hashmap-gem5-stats

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class Main(common.LkmcCliFunction):
1111
},
1212
description='''\
1313
Convert a BST vs heap stat file into a gnuplot input
14+
https://github.com/cirosantilli/linux-kernel-module-cheat#bst-vs-heap-vs-hashmap
1415
''',
1516
)
1617

bst-vs-heap-vs-hashmap.gnuplot

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
#!/usr/bin/env gnuplot
22

3+
# https://github.com/cirosantilli/linux-kernel-module-cheat#bst-vs-heap-vs-hashmap
4+
#
5+
# A stacked plot with a single xlabel as shown at:
6+
#
7+
# * https://tex.stackexchange.com/questions/346882/creating-an-equally-distributed-multiplot-with-gnuplottex
8+
# * http://gnuplot.sourceforge.net/demo_canvas_5.2/layout.html
9+
#
10+
# would be even nicer, but it was hard to get right, and this
11+
# is pretty good already.
12+
313
set terminal png noenhanced size 800, 1400
414
set output input_noext . ".tmp.png"
515
set multiplot layout 5,1 title "\nC++ Heap vs BST vs Hash map insert time" font ",22"
6-
set xlabel "container size"
7-
set ylabel "insert time (ns)"
16+
set lmargin 12
17+
set label "Insert time (ns)" at screen 0.05,0.5 center front rotate font ",16"
818
set title font ",16"
19+
set format y "%5.0f"
920

1021
set title "Heap (std::priority_queue)"
1122
plot input_noext . ".dat" using 1:2 notitle
@@ -22,6 +33,7 @@ set title "Hash map (std::unordered_set)"
2233
set yrange [*:*]
2334
plot input_noext . ".dat" using 1:4 notitle
2435

25-
set title "Hash map zoom"
36+
set xlabel "Container size" font ",16"
37+
set title "Hash map (zoom)"
2638
set yrange [0:hashmap_zoom_max]
2739
plot input_noext . ".dat" using 1:4 notitle

0 commit comments

Comments
 (0)