Ignore:
Timestamp:
Jun 4, 2025, 1:43:34 PM (4 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
f858ca5
Parents:
c8bdbaf
Message:

Recent rework of string benchmarks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/mike_brooks_MMath/plots/string-allocn.gp

    rc8bdbaf re0350e0  
    55INDIR="build"
    66OUTDIR="build"
     7SRCDIR="plots"
    78
    89SCALE=1024
     
    1112set macros
    1213set output OUTDIR."/plot-string-allocn.pdf"
    13 set multiplot layout 1, 3 ;
    14 set key outside top center horizontal
     14set multiplot layout 1, 2 ;
    1515set grid
    1616
    17 # common to only first two graphs
    18 set logscale x 2
    19 #set mxtics 3                      # 3 steps within each doubling (e.g. 3 steps of of 32 between 32 and 128 => tick on 32s in there)
    20 set xlabel "Heap Used (B)"
    21 set logscale y 10
    2217
    2318#
     
    2520#
    2621
     22#set errorbars dashtype '.'
     23
     24set logscale x 2
     25set xlabel "Heap Used (B)"
     26set logscale y 10
     27set key outside top center
     28
    2729set ylabel "Duration (ns)" offset 2,0
    28 set yrange[35:125]
    29 set ytics add (40, 50, 60, 70, 80, 90, 110, 120)
     30set yrange[40:150]
     31set ytics add (40, 50, 60, 70, 80, 90, 110, 120, 130, 140, 150)
    3032
    31 set xrange[32:4096]
     33set xrange[32:8192]
    3234set xtics rotate by -90
    3335set xtics ("" 32, "64 k" 64, "" 128, "256 k" 256, "" 512, "1 M" 1024, "" 2048, "4 M" 4096)
     
    3537# First each curve, then each default-expansion point
    3638plot INDIR."/plot-string-allocn.dat" \
    37            i 0 using ($3/SCALE):2 title columnheader(1) with linespoints lt rgb "blue"    pt  2   ps 1 lw 1, \
    38         '' i 1 using ($3/SCALE):2 title columnheader(1) with linespoints lt rgb "red"     pt  3   ps 1 lw 1, \
    39         '' i 2 using ($3/SCALE):2 title columnheader(1) with linespoints lt rgb "brown"   pt  8   ps 1 lw 1, \
    40         '' i 3 using ($3/SCALE):2 title columnheader(1) with linespoints lt rgb "black"   pt  10  ps 1 lw 1, \
    41         '' i 4 using ($3/SCALE):2 title columnheader(1) with linespoints lt rgb "magenta" pt  12  ps 1 lw 1, \
    42         '' i 0 using ( ($4 == 1) ? ($3/SCALE) : 1/0 ):2 notitle with points lt rgb "blue"    pt  66 ps 2, \
    43         '' i 1 using ( ($4 == 1) ? ($3/SCALE) : 1/0 ):2 notitle with points lt rgb "red"     pt  66 ps 2, \
    44         '' i 2 using ( ($4 == 1) ? ($3/SCALE) : 1/0 ):2 notitle with points lt rgb "brown"   pt  66 ps 2, \
    45         '' i 3 using ( ($4 == 1) ? ($3/SCALE) : 1/0 ):2 notitle with points lt rgb "black"   pt  66 ps 2, \
    46         '' i 4 using ( ($4 == 1) ? ($3/SCALE) : 1/0 ):2 notitle with points lt rgb "magenta" pt  66 ps 2
     39           i 0 using ($5/SCALE):2     notitle               with lines      lt rgb "blue"        dt '.'  lw 2, \
     40        '' i 1 using ($5/SCALE):2     notitle               with lines      lt rgb "red"         dt '.'  lw 2, \
     41        '' i 2 using ($5/SCALE):2     notitle               with lines      lt rgb "brown"       dt '.'  lw 2, \
     42        '' i 3 using ($5/SCALE):2     title "tuning contour" with lines     lt rgb "black"       dt '.'  lw 2, \
     43        '' i 4 using ($5/SCALE):2     notitle               with lines      lt rgb "magenta"     dt '.'  lw 2, \
     44        '' i 0 using ($5/SCALE):2:3:4 notitle               with yerrorbars lt rgb "blue"    pt  7  ps 0.25 lw 1, \
     45        '' i 1 using ($5/SCALE):2:3:4 notitle               with yerrorbars lt rgb "red"     pt  7  ps 0.25 lw 1, \
     46        '' i 2 using ($5/SCALE):2:3:4 notitle               with yerrorbars lt rgb "brown"   pt  7  ps 0.25 lw 1, \
     47        '' i 3 using ($5/SCALE):2:3:4 notitle               with yerrorbars lt rgb "black"   pt  7  ps 0.25 lw 1, \
     48        '' i 4 using ($5/SCALE):2:3:4 notitle               with yerrorbars lt rgb "magenta" pt  7  ps 0.25 lw 1, \
     49        '' i 0 using ( ($8 == 1) ? ($5/SCALE) : 1/0 ):2 notitle with points lt rgb "blue"    pt  66 ps 2, \
     50        '' i 1 using ( ($8 == 1) ? ($5/SCALE) : 1/0 ):2 notitle with points lt rgb "red"     pt  66 ps 2, \
     51        '' i 2 using ( ($8 == 1) ? ($5/SCALE) : 1/0 ):2 notitle with points lt rgb "brown"   pt  66 ps 2, \
     52        '' i 3 using ( ($8 == 1) ? ($5/SCALE) : 1/0 ):2 title "default tuning" \
     53                                                                with points lt rgb "black"   pt  66 ps 2, \
     54        '' i 4 using ( ($8 == 1) ? ($5/SCALE) : 1/0 ):2 notitle with points lt rgb "magenta" pt  66 ps 2, \
     55        '' i 0 using ($5/SCALE):2:("{/Times=15 len-\n20")  every ::1::1 with labels left  offset  0.75,0.25 textcolor rgb "blue"    notitle, \
     56        '' i 1 using ($5/SCALE):2:("{/Times=15 len-\n50")  every ::5::5 with labels right offset -0.6 ,1.5  textcolor rgb "red"     notitle, \
     57        '' i 2 using ($5/SCALE):2:("{/Times=15 len-\n100") every ::4::4 with labels right offset -0.75,0.5  textcolor rgb "brown"   notitle, \
     58        '' i 3 using ($5/SCALE):2:("{/Times=15 len-\n200") every ::4::4 with labels right offset -0.75,1.25 textcolor rgb "black"   notitle, \
     59        '' i 4 using ($5/SCALE):2:("{/Times=15 len-\n500") every ::4::4 with labels right offset -0.75,0.25 textcolor rgb "magenta" notitle, \
     60        '' i 5 using                          ($5/SCALE)        :2     notitle               with lines       lt rgb "#BF007F7F"               lw 8, \
     61        '' i 6 using                          ($5/SCALE)        :2     notitle               with lines       lt rgb "#BF007F7F"               lw 8, \
     62        '' i 7 using                          ($5/SCALE)        :2     notitle               with lines       lt rgb "#BF007F7F"               lw 8, \
     63        '' i 8 using                          ($5/SCALE)        :2     title "tradeoff"      with lines       lt rgb "#BF007F7F"              lw 8, \
     64        '' i 9 using                          ($5/SCALE)        :2     notitle               with lines       lt rgb "#BF007F7F"               lw 8, \
     65        '' i 5 using ( (strcol(8) eq "stl") ? ($5/SCALE) : 1/0 ):2:3:4 notitle               with yerrorbars  lt rgb "#00007F7F"  pt 6     ps 0.5 lw 2 ,       \
     66        '' i 6 using ( (strcol(8) eq "stl") ? ($5/SCALE) : 1/0 ):2:3:4 notitle               with yerrorbars  lt rgb "#00007F7F"  pt 6     ps 0.5 lw 2 ,       \
     67        '' i 7 using ( (strcol(8) eq "stl") ? ($5/SCALE) : 1/0 ):2:3:4 notitle               with yerrorbars  lt rgb "#00007F7F"  pt 6     ps 0.5 lw 2 ,       \
     68        '' i 8 using ( (strcol(8) eq "stl") ? ($5/SCALE) : 1/0 ):2:3:4 notitle               with yerrorbars  lt rgb "#00007F7F"  pt 6     ps 0.5 lw 2 , \
     69        '' i 9 using ( (strcol(8) eq "stl") ? ($5/SCALE) : 1/0 ):2:3:4 notitle               with yerrorbars  lt rgb "#00007F7F"  pt 6     ps 0.5 lw 2
     70
    4771
    4872unset ylabel
     73unset xlabel
    4974
    5075unset xtics
     
    5378unset xrange
    5479
    55 
    56 #
    57 # STL comparison
    58 #
    59 
    60 
    61 set yrange[40:85]
    62 set ytics add (40, 45, 50, 55, 60, 65, 70, 75, 80, 85)
    63 set mytics 90                     # 90 steps within each decade (e.g. 90 steps of of 1 between 10 and 100 => tick on 1s in there)
    64 
    65 set xrange[64:4096]
    66 set xtics rotate by -90
    67 set xtics ("64 k" 64, "128 k" 128, "256 k" 256, "512 k" 512, "1 M" 1024, "2 M" 2048, "4 M" 4096)
    68 
    69 # skullduggeries:
    70 # hardcoding chunk index and assuming data in the chunk (by hardcoding only the stl series title)
    71 # series order is meaningless but important: achieves z-order readability and legend order acceptability
    72 
    73 plot INDIR."/plot-string-allocn.dat" \
    74            i 8 using                          ($3/SCALE)        :2 title "tradeoff"      with lines       lt rgb "#77000000"  dt (2,2)       lw 8, \
    75         '' i 1 using                          ($3/SCALE)        :2 title columnheader(1) with linespoints lt rgb "red"        pt  3    ps 1  lw 1, \
    76         '' i 6 using ( (strcol(4) eq "cfa") ? ($3/SCALE) : 1/0 ):2 notitle               with points      lt rgb "red"        pt 66    ps 2,       \
    77         '' i 6 using                          ($3/SCALE)        :2 notitle               with lines       lt rgb "#77000000"  dt (2,2)       lw 8, \
    78         '' i 6 using ( (strcol(4) eq "stl") ? ($3/SCALE) : 1/0 ):2 title "stl, len=50"   with points      lt rgb "red"        pt 5     ps 1,       \
    79         '' i 3 using                          ($3/SCALE)        :2 title columnheader(1) with linespoints lt rgb "black"      pt  10   ps 1  lw 1, \
    80         '' i 8 using ( (strcol(4) eq "stl") ? ($3/SCALE) : 1/0 ):2 title "stl, len=200"  with points      lt rgb "black"      pt 5     ps 1,       \
    81         '' i 8 using ( (strcol(4) eq "cfa") ? ($3/SCALE) : 1/0 ):2 notitle               with points      lt rgb "black"      pt 66    ps 2
    82 
    83 
    84 unset mytics
    85 unset ytics
    86 unset yrange
    87 unset xrange
    88 
    89 
    90 
    91 # common to first two graphs
    9280unset logscale
    9381unset xlabel
     
    9886#
    9987
    100 set style data histogram
     88set key outside top center vertical maxrows 3
     89
     90set logscale x 2
     91#set mxtics 3                      # 3 steps within each doubling (e.g. 3 steps of of 32 between 32 and 128 => tick on 32s in there)
     92
     93set yrange[0:105]
    10194set ytics auto
    102 set style histogram clustered gap 1 rowstacked
    103 set style fill solid border -1
    104 set boxwidth 0.8
    105 set xtics rotate by -45
    10695
    107 plot for [col=3:8] \
    108     INDIR.'/plot-string-allocn-attrib.dat' using col:xticlabels(stringcolumn(2).", len=".stringcolumn(1)) index 0 title columnheader(col)
     96set xrange[2.0e4:3e7]
     97# set xtics rotate by -90
     98# set xtics ("" 32, "64 k" 64, "" 128, "256 k" 256, "" 512, "1 M" 1024, "" 2048, "4 M" 4096)
     99
     100set style fill solid 1.0
     101
     102BAR_RELWD = 0.5
     103BAR_XSHIFT = (1+BAR_RELWD)**(-0.55)
     104LEN_X_SEP = 1.7
     105
     106# get segment draw order (front to back) from metadata file
     107meta = system('cat '.SRCDIR.'/string-allocn-attrib-meta.dat')
     108STATS_words = words(meta)
     109array STATS_word[STATS_words]
     110do for [i=1:STATS_words] {
     111    STATS_word[i] = word(meta, i)
     112}
     113
     114
     115
     116plot \
     117        for [i=STATS_words:1:-1] \
     118        INDIR.'/plot-string-allocn-attrib.dat' \
     119                using (stringcolumn("category") eq STATS_word[i] ? (BAR_XSHIFT*$1**LEN_X_SEP*$3/SCALE) : 1/0): \
     120                          (stringcolumn("category") eq STATS_word[i] ? ($5 + $8) : 1/0): \
     121                          (stringcolumn("category") eq STATS_word[i] ? (BAR_RELWD*(BAR_XSHIFT*$1**LEN_X_SEP*$3/SCALE)) : 1/0) \
     122                with boxes ls i title STATS_word[i], \
     123        INDIR."/plot-string-allocn.dat" \
     124           i 1 using (50 **LEN_X_SEP*$5/SCALE):2     notitle with lines      lt rgb "red"         dt '.'  lw 2, \
     125        '' i 3 using (200**LEN_X_SEP*$5/SCALE):2     notitle with lines      lt rgb "black"       dt '.'  lw 2, \
     126        '' i 1 using ( ($8 == 1) ? (50 **LEN_X_SEP*$5/SCALE) : 1/0 ):2 notitle with points lt rgb "red"     pt  66 ps 2, \
     127        '' i 3 using ( ($8 == 1) ? (200**LEN_X_SEP*$5/SCALE) : 1/0 ):2 notitle with points lt rgb "black"   pt  66 ps 2, \
     128        '' i 1 using ( ($8 == 1) ? (50 **LEN_X_SEP*$5/SCALE) : 1/0 ):2:3:4 notitle with yerrorbars lt rgb "red"     pt  7  ps 0.25 lw 1, \
     129        '' i 3 using ( ($8 == 1) ? (200**LEN_X_SEP*$5/SCALE) : 1/0 ):2:3:4 notitle with yerrorbars lt rgb "black"   pt  7  ps 0.25 lw 1, \
     130        '' i 1 using (50 **LEN_X_SEP*$5/SCALE):2:("{/Times=15 len-\n50")  every ::5::5 with labels right offset -0.6 ,1.5  textcolor rgb "red"     notitle, \
     131        '' i 3 using (200**LEN_X_SEP*$5/SCALE):2:("{/Times=15 len-\n200") every ::4::4 with labels right offset -0.75,1.25 textcolor rgb "black"   notitle, \
     132        '' i 6 using                          (50 **LEN_X_SEP*$5/SCALE)        :2     notitle      with lines   lt rgb "#BF007F7F"               lw 8, \
     133        '' i 8 using                          (200**LEN_X_SEP*$5/SCALE)        :2     notitle      with lines   lt rgb "#BF007F7F"              lw 8, \
     134        '' i 6 using ( (strcol(8) eq "stl") ? (50 **LEN_X_SEP*$5/SCALE) : 1/0 ):2:3:4     notitle      with yerrorbars  lt rgb "#00007F7F"  pt 6     ps 0.5 lw 2 ,       \
     135        '' i 8 using ( (strcol(8) eq "stl") ? (200**LEN_X_SEP*$5/SCALE) : 1/0 ):2:3:4     notitle      with yerrorbars  lt rgb "#00007F7F"  pt 6     ps 0.5 lw 2
     136
     137
     138#          i 6 using                          ($5/SCALE)        :2:(BAR_RELWD*($5/SCALE))     notitle               with boxes  lt rgb "grey"    , \
     139#       '' i 8 using                          ($5/SCALE)        :2:(BAR_RELWD*($5/SCALE))     notitle               with boxes  lt rgb "grey"    , \
     140#       '' i 6 using                          ($5/SCALE)        :($2-40):(BAR_RELWD*($5/SCALE))     notitle               with boxes  lt rgb "blue", \
     141#       '' i 8 using                          ($5/SCALE)        :($2-40):(BAR_RELWD*($5/SCALE))     notitle               with boxes  lt rgb "blue", \
Note: See TracChangeset for help on using the changeset viewer.