bst_vst_heap_vs_hashmap: make graph beautiful

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-06-28 00:00:00 +00:00
parent 3fdd83c2c5
commit b7318fb124
2 changed files with 16 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ class Main(common.LkmcCliFunction):
},
description='''\
Convert a BST vs heap stat file into a gnuplot input
https://github.com/cirosantilli/linux-kernel-module-cheat#bst-vs-heap-vs-hashmap
''',
)

View File

@@ -1,11 +1,22 @@
#!/usr/bin/env gnuplot
# https://github.com/cirosantilli/linux-kernel-module-cheat#bst-vs-heap-vs-hashmap
#
# A stacked plot with a single xlabel as shown at:
#
# * https://tex.stackexchange.com/questions/346882/creating-an-equally-distributed-multiplot-with-gnuplottex
# * http://gnuplot.sourceforge.net/demo_canvas_5.2/layout.html
#
# would be even nicer, but it was hard to get right, and this
# is pretty good already.
set terminal png noenhanced size 800, 1400
set output input_noext . ".tmp.png"
set multiplot layout 5,1 title "\nC++ Heap vs BST vs Hash map insert time" font ",22"
set xlabel "container size"
set ylabel "insert time (ns)"
set lmargin 12
set label "Insert time (ns)" at screen 0.05,0.5 center front rotate font ",16"
set title font ",16"
set format y "%5.0f"
set title "Heap (std::priority_queue)"
plot input_noext . ".dat" using 1:2 notitle
@@ -22,6 +33,7 @@ set title "Hash map (std::unordered_set)"
set yrange [*:*]
plot input_noext . ".dat" using 1:4 notitle
set title "Hash map zoom"
set xlabel "Container size" font ",16"
set title "Hash map (zoom)"
set yrange [0:hashmap_zoom_max]
plot input_noext . ".dat" using 1:4 notitle