else
return 0
fi
+ if test -n "$html"; then
+ echo >>"$html" "<h2>$1</h2>"
+ fi
echo "*"
echo "* $1 *****"
echo "*"
shift
if test -n "$fast"; then
run_command "$@" ../src/nitg.nit -o "nitg.$title.bin"
- bench_command "nitg" "nitg --global ../src/test_parser.nit" "./nitg.$title.bin" -v --global --no-cc ../src/test_parser.nit
+ bench_command "nitg-g" "nitg --global ../src/test_parser.nit" "./nitg.$title.bin" -v --global --no-cc ../src/test_parser.nit
run_command "$@" ../src/nit.nit -o "nit.$title.bin"
bench_command "nit" "nit ../src/test_parser.nit ../src/location.nit" "./nit.$title.bin" -v ../src/test_parser.nit -- -n ../src/location.nit
run_command "$@" ../examples/shoot/shoot_logic.nit -o "shoot.$title.bin"
bench_command "bintrees" "bench_bintree_gen 16" "./bintrees.$title.bin" 16
else
run_command "$@" ../src/nitg.nit -o "nitg.$title.bin"
- bench_command "nitg" "nitg --global --no-cc ../src/nitmetrics.nit" "./nitg.$title.bin" -v --global --no-cc ../src/nitmetrics.nit
+ bench_command "nitg-g" "nitg --global --no-cc ../src/nitmetrics.nit" "./nitg.$title.bin" -v --global --no-cc ../src/nitmetrics.nit
bench_command "nitg-s" "nitg --separate ../src/nitg.nit" "./nitg.$title.bin" -v --no-cc --separate ../src/nitg.nit
run_command "$@" ../src/nit.nit -o "nit.$title.bin"
bench_command "nit" "nit ../src/test_parser.nit ../src/rapid_type_analysis.nit" "./nit.$title.bin" -v ../src/test_parser.nit -- -n ../src/rapid_type_analysis.nit
bench_command "shoot" "shoot_logic 30" "./shoot.$title.bin" 30
run_command "$@" ../tests/bench_bintree_gen.nit -o "bintrees.$title.bin"
bench_command "bintrees" "bench_bintree_gen 18" "./bintrees.$title.bin" 18
- run_command "$@" "$pep8analysis/src/pep8analysis.nit" -I "$pep8analysis/lib" -o "pep8a.$title.bin"
- bench_command "pep8analisis" "bench_bintree_gen 18" "./pep8a.$title.bin" "$pep8analysis/tests/privat/"*.pep
+ if test -f "$pep8analysis/src/pep8analysis.nit"; then
+ run_command "$@" "$pep8analysis/src/pep8analysis.nit" -I "$pep8analysis/lib" -o "pep8a.$title.bin"
+ bench_command "pep8analisis" "bench_bintree_gen 18" "./pep8a.$title.bin" "$pep8analysis/tests/privat/"*.pep
+ fi
fi
}
echo " -n count: number of execution for each bar (default: $count)"
echo " --dry: Do not run the commands, just reuse the data and generate the graph"
echo " --fast: Run less and faster tests"
+ echo " --html: Generate and HTML output"
echo " -h: this help"
}
-n) count="$2"; shift; shift;;
--dry) dry_run=true; shift;;
--fast) fast=true; shift;;
+ --html) html="index.html"; echo >"$html" "<html><head></head><body>"; shift;;
*) stop=true
esac
done
bench_command "generate c" "" ../src/nitc_3 --global --no-cc ../src/nitg.nit
bench_command "full" "" ../src/nitc_3 -O --global ../src/nitg.nit -o "nitg_nitc-g.bin"
- prepare_res "$name-nitg.dat" "nitg" "Various steps of nitg --global"
+ prepare_res "$name-nitg.dat" "nitg-g" "Various steps of nitg --global"
bench_command "parse" "" ./nitg --global --only-parse ../src/nitg.nit
bench_command "metamodel" "" ./nitg --global --only-metamodel ../src/nitg.nit
bench_command "generate c" "" ./nitg --global --no-cc ../src/nitg.nit
bench_command "full" "" ./nitg --global ../src/nitg.nit -o "nitg_nitg.bin"
+ prepare_res "$name-nitg-s.dat" "nitg-s" "Various steps of nitg --separate"
+ bench_command "parse" "" ./nitg --separate --only-parse ../src/nitg.nit
+ bench_command "metamodel" "" ./nitg --separate --only-metamodel ../src/nitg.nit
+ bench_command "generate c" "" ./nitg --separate --no-cc ../src/nitg.nit
+ bench_command "full" "" ./nitg --separate ../src/nitg.nit -o "nitg_nitg-e.bin"
+
prepare_res "$name-nitg-e.dat" "nitg-e" "Various steps of nitg --erasure"
bench_command "parse" "" ./nitg --erasure --only-parse ../src/nitg.nit
bench_command "metamodel" "" ./nitg --erasure --only-metamodel ../src/nitg.nit
bench_steps
# $#: options to compare
-function bench_nitg_options()
+function bench_nitg-g_options()
{
tag=$1
shift
name="$FUNCNAME-$tag"
skip_test "$name" && return
- prepare_res "$name.dat" "no options" "nitg without options"
- run_compiler "nitg" ./nitg --global
-
- if test -n "$2"; then
- prepare_res "$name-all.dat" "all" "nitg with all options $@"
- run_compiler "nitg-$tag" ./nitg --global $@
+ prepare_res "$name.dat" "no options" "nitg-g without options"
+ run_compiler "nitg-g" ./nitg --global
+
+ if test "$1" = NOALL; then
+ shift
+ elif test -n "$2"; then
+ prepare_res "$name-all.dat" "all" "nitg-g with all options $@"
+ run_compiler "nitg-g-$tag" ./nitg --global $@
fi
for opt in "$@"; do
- prepare_res "$name$opt.dat" "$opt" "nitg with option $opt"
- run_compiler "nitg$opt" ./nitg --global $opt
+ prepare_res "$name$opt.dat" "$opt" "nitg-g with option $opt"
+ run_compiler "nitg-g$opt" ./nitg --global $opt
done
plot "$name.gnu"
}
-bench_nitg_options "hardening" --hardening
-bench_nitg_options "nocheck" --no-check-covariance --no-check-initialization --no-check-assert --no-check-autocast --no-check-other
+bench_nitg-g_options "hardening" --hardening
+bench_nitg-g_options "nocheck" --no-check-covariance --no-check-initialization --no-check-assert --no-check-autocast --no-check-other
function bench_nitg-s_options()
{
prepare_res "$name.dat" "no options" "nitg-s without options"
run_compiler "nitg-s" ./nitg --separate
- if test -n "$2"; then
+ if test "$1" = NOALL; then
+ shift
+ elif test -n "$2"; then
prepare_res "$name-all.dat" "all" "nitg-s with all options $@"
run_compiler "nitg-s-$tag" ./nitg --separate $@
fi
plot "$name.gnu"
}
-bench_nitg-s_options "slower" --hardening --no-inline-intern --generic-resolution-tree --no-union-attribute --no-shortcut-equal --no-shortcut-range
+bench_nitg-s_options "slower" --hardening --no-inline-intern --no-union-attribute --no-shortcut-equal --no-shortcut-range
bench_nitg-s_options "nocheck" --no-check-covariance --no-check-initialization --no-check-assert --no-check-autocast --no-check-other
bench_nitg-s_options "faster" --inline-coloring-numbers
-bench_nitg-s_options "typing" --bm-typing --phand-typing
+bench_nitg-s_options "typing" NOALL --bm-typing --phand-typing
function bench_nitg-e_options()
{
prepare_res "$name.dat" "no options" "nitg-e without options"
run_compiler "nitg-e" ./nitg --erasure
- if test -n "$2"; then
+ if test "$1" = NOALL; then
+ shift
+ elif test -n "$2"; then
prepare_res "$name-all.dat" "all" "nitg-e with all options $@"
run_compiler "nitg-e-$tag" ./nitg --erasure $@
fi
bench_nitg-e_options "slower" --hardening --no-inline-intern --no-union-attribute --no-shortcut-equal --no-shortcut-range
bench_nitg-e_options "nocheck" --no-check-covariance --no-check-initialization --no-check-assert --no-check-autocast --no-check-other --no-check-erasure-cast
bench_nitg-e_options "faster" --inline-coloring-numbers
-bench_nitg-e_options "typing" --bm-typing --phand-typing
+bench_nitg-e_options "typing" NOALL --bm-typing # --phand-typing
function bench_nitc_gc()
{
run_compiler "nitc" ../src/nitc_3 -O
prepare_res "$name-nitc-g.dat" "nitc-g" "nitc with --global"
run_compiler "nitc-g" ../src/nitc_3 -O --global
- prepare_res "$name-nitg.dat" "nitg" "nitg with --global"
- run_compiler "nitg" ./nitg --global
+ prepare_res "$name-nitg-g.dat" "nitg-g" "nitg with --global"
+ run_compiler "nitg-g" ./nitg --global
prepare_res "$name-nitg-s.dat" "nitg-s" "nitg with --separate"
run_compiler "nitg-s" ./nitg --separate
prepare_res "$name-nitg-e.dat" "nitg-e" "nitg with --erasure"
prepare_res "$name-nitc-bohem.dat" "nitc-boehm" "nitc with boehm"
NIT_GC_OPTION="boehm" run_compiler "nitc" ../src/nitc_3 -O
prepare_res "$name-nitg-e-nockeck-malloc.dat" "nitg-e-nc-malloc" "nitg with --erasure --no-check-autocast --no-check-erasure-cast and malloc"
- run_compiler "nitg-e-nc-malloc" ./nitg --erasure --no-check-autocast --no-check-erasure-cast --make-flags "CFLAGS=\"-O2 -DNOBOEHM\""
+ NIT_GC_OPTION="malloc" run_compiler "nitg-e-nc-malloc" ./nitg --erasure --no-check-autocast --no-check-erasure-cast
prepare_res "$name-nitg-e-nockeck.dat" "nitg-e-nc" "nitg with --erasure --no-check-autocast --no-check-erasure-cast"
run_compiler "nitg-e-nc" ./nitg --erasure --no-check-autocast --no-check-erasure-cast
prepare_res "$name-nitg-e.dat" "nitg-e" "nitg with --erasure"
name="$FUNCNAME"
skip_test "$name" && return
prepare_res "$name-nitg-e-malloc.dat" "nitg-e-malloc" "nitg with --erasure and malloc"
- run_compiler "nitg-e-malloc" ./nitg --erasure --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
- prepare_res "$name-nitg-e-noatomic.dat" "nitg-e-noatomic" "nitg with --erasure and no atomic"
- run_compiler "nitg-e-noatomic" ./nitg --erasure --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM_ATOMIC\""
+ NIT_GC_OPTION="malloc" run_compiler "nitg-e-malloc" ./nitg --erasure
prepare_res "$name-nitg-e.dat" "nitg-e" "nitg with --erasure"
run_compiler "nitg-e" ./nitg --erasure
plot "$name.gnu"
for i in ../examples/hello_world.nit ../src/test_parser.nit ../src/nitg.nit; do
bench_command `basename "$i" .nit` "" ../src/nitc_3 -O "$i" --no-cc
done
- prepare_res "$name-nitg.dat" "nitg" "nitg"
+ prepare_res "$name-nitg.dat" "nitg-g" "nitg --global"
for i in ../examples/hello_world.nit ../src/test_parser.nit ../src/nitg.nit; do
bench_command `basename "$i" .nit` "" ./nitg --global "$i" --no-cc
done
+ prepare_res "$name-nitg-e.dat" "nitg-e" "nitg --separate"
+ for i in ../examples/hello_world.nit ../src/test_parser.nit ../src/nitg.nit; do
+ bench_command `basename "$i" .nit` "" ./nitg --separate "$i" --no-cc
+ done
prepare_res "$name-nitg-e.dat" "nitg-e" "nitg --erasure"
for i in ../examples/hello_world.nit ../src/test_parser.nit ../src/nitg.nit; do
bench_command `basename "$i" .nit` "" ./nitg --erasure "$i" --no-cc
}
bench_compilation_time
+if test -n "$html"; then
+ echo >>"$html" "</body></html>"
+fi
+
if test -n "$died"; then
echo "Some commands failed"
exit 1