bst-vs-heap-vs-hashmap.gnuplot 1.2 KB

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