Created
March 27, 2026 14:47
-
-
Save damiendoligez/74c6da225f78b60b78556297a712ce54 to your computer and use it in GitHub Desktop.
Benchmarking script for space/time curves for OCaml.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| datadir=$HOME/work/csl/gc-bench/26c26-pr14329-note | |
| commits=' | |
| #label:commit | |
| @trunk:f462edbb18 | |
| @before-14329:130cc91e5e | |
| @after-14329:1a7c3888a5 | |
| @before-14365:57de42d571 | |
| @after-14365:7ea34c55cc | |
| @14571:31ea764329 | |
| @14571-rebased:a9d4805daf | |
| ' | |
| function bench() { | |
| git checkout $1 >&2 || return | |
| make distclean >&2 || return | |
| ./configure >&2 || return | |
| make -j8 >&2 || return | |
| for (( ovh = 30; ovh <= 300; ovh += ovh/40 ? ovh/40 : 1 )); do | |
| echo $ovh $2 $1 >&2 | |
| for i in 0; do | |
| rm -f ocamldoc/*.cm* | |
| OCAMLRUNPARAM=$OCAMLRUNPARAM,o=$ovh,v=0x400 \ | |
| /usr/bin/time -p make ocamldoc >/dev/null 2>foo.log | |
| printf "%d %s " $ovh $i | |
| awk '/top_heap_words:/ { s += $2; } | |
| /user/ {t = $2} | |
| END {print(t, s)}' \ | |
| foo.log | |
| done | |
| done >$datadir/$1.data | |
| } | |
| cat >$datadir/gp-script <<EOF | |
| set terminal qt size 600,600 persist title "time/space" | |
| set xlabel "sum of max heap sizes (MB)" | |
| set ylabel "time (s)" | |
| plot \\ | |
| EOF | |
| for c in $commits; do | |
| commit=${c##*:} | |
| label=${c%%:*} | |
| show=true | |
| case $label in | |
| '@'*) label=${label#'@'};; | |
| '#'*) show=false ;; | |
| *) bench $commit $label;; | |
| esac | |
| if $show; then | |
| printf ' "%s.data" using ($4/1000000):3 title "%s", \\\n' \ | |
| $commit $label >>$datadir/gp-script | |
| fi | |
| done | |
| echo >>$datadir/gp-script | |
| cd $datadir | |
| gnuplot gp-script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment