# Can be overrided with 'the option -n'
count=2
-### HELPER FUNCTIONS ##
-
-function die()
-{
- echo >&2 "error: $*"
- died=1
-}
-
# HELPER FOR NIT #
# Run standards benchs on a compiler command
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$fast; shift;;
- --html) html="index.html"; echo >"$html" "<html><head></head><body>"; shift;;
+ --html) shift;; # Deprecated
*) stop=true
esac
done
+html="index.html"
+echo >"$html" "<html><head></head><body>"
+
xml="bench_engines.xml"
echo "<testsuites><testsuite>" > "$xml"
for opt in "$@"; do
ot=${opt// /}
- prepare_res "$name$ot.dat" "$opt" "nitc-g with option $opt"
+ prepare_res "$name$ot.dat" "$opt" "nitc with option $opt"
run_compiler "nitc-$name" ./nitc $common $opt
done
if test -n "$2" -a -n "$withall"; then
- prepare_res "$name-all.dat" "all" "nitc-g with all options $@"
+ prepare_res "$name-all.dat" "all" "nitc with all options $@"
run_compiler "nitc-$name" ./nitc $common $@
fi
bench_nitc_options "slower" --global --hardening --no-shortcut-range
bench_nitc_options "nocheck" --global --no-check-null --no-check-autocast --no-check-attr-isset --no-check-covariance --no-check-assert
-bench_nitc_options "slower" --separate --hardening --no-shortcut-equal --no-union-attribute --no-shortcut-range --no-inline-intern "--no-gcc-directive likely --no-gcc-directive noreturn" "--no-tag-primitives"
+bench_nitc_options "slower" --separate --hardening --no-shortcut-equal --no-union-attribute --no-shortcut-range --no-inline-intern "--no-gcc-directive likely --no-gcc-directive noreturn" "--no-tag-primitives" "--colo-dead-methods" --type-poset
bench_nitc_options "nocheck" --separate --no-check-null --no-check-autocast --no-check-attr-isset --no-check-covariance --no-check-assert
bench_nitc_options "faster" --separate --skip-dead-methods --inline-coloring-numbers --inline-some-methods --direct-call-monomorph "--inline-some-methods --direct-call-monomorph"
bench_nitc_options "slower" --erasure --hardening --no-shortcut-equal --no-union-attribute --no-shortcut-range --no-inline-intern
-bench_nitc_options "nocheck" --erasure --no-check-null --no-check-autocast --no-check-attr-isset --no-check-covariance --no-check-assert --no-check-erasure-cast
+bench_nitc_options "nocheck" --erasure --no-check-null --no-check-autocast --no-check-attr-isset --no-check-covariance --no-check-assert --no-check-erasure-cast --no-check-all
bench_nitc_options "faster" --erasure --skip-dead-methods --inline-coloring-numbers --inline-some-methods --direct-call-monomorph --rta
bench_nitc_options "engine" "" NOALL "--separate" "--erasure" "--separate --semi-global" "--erasure --semi-global" "--erasure --semi-global --rta" "--global"
bench_nitc_options "policy" "" NOALL "--separate" "--erasure" "--separate --no-check-covariance" "--erasure --no-check-covariance --no-check-erasure-cast"
bench_nitc_options "nullables" "" "--no-check-attr-isset" "--no-union-attribute"
-bench_nitc_options "linkboost" "" NOALL --trampoline-call --colors-are-symbols "--colors-are-symbols --trampoline-call" "--separate --link-boost" "--separate --colors-are-symbols --guard-call" "--separate --colors-are-symbols --direct-call-monomorph0"
+bench_nitc_options "linkboost" "" NOALL --trampoline-call --colors-are-symbols "--colors-are-symbols --trampoline-call" "--separate --link-boost" "--separate --colors-are-symbols --guard-call" "--separate --colors-are-symbols --direct-call-monomorph0" "--substitute-monomorph"
bench_nitc_options "monomorph" "" --direct-call-monomorph0 --direct-call-monomorph
+bench_nitc_options "misc" "" --log --typing-test-metrics --invocation-metrics --isset-checks-metrics --tables-metrics --no-stacktrace --release --debug #FIXME add --sloppy
+
function bench_nitc-e_gc()
{
name="$FUNCNAME"
}
bench_compilation_time
-if test -n "$html"; then
- echo >>"$html" "</body></html>"
-fi
+echo >>"$html" "</body></html>"
echo >>"$xml" "</testsuite></testsuites>"
# Can be overrided with 'the option -n'
count=2
-### HELPER FUNCTIONS ##
-
-function die()
-{
- echo >&2 "error: $*"
- died=1
-}
+# Default number of times the input file is transformed during a single run
+s=200
## HANDLE OPTIONS ##
echo "run_bench: [options]* benchname"
echo " -v: verbose mode"
echo " -n count: number of execution for each bar (default: $count)"
+ echo " -s size: number of transformations for each run (default: $s)"
echo " --dry: Do not run the commands, just reuse the data and generate the graph"
echo " -h: this help"
}
-v) verbose=true; shift;;
-h) usage; exit;;
-n) count="$2"; shift; shift;;
+ -s) s="$2"; shift; shift;;
--dry) dry_run=true; shift;;
*) stop=true
esac
engdir="./engines"
bncdir="./benches/out"
mkdir -p $outdir
-
-s=200
+html="index.html"
+echo >"$html" "<html><head></head><body>"
function bench_nitmd()
{
plot $outdir/bench_markdown.gnu
fi
+echo >>"$html" "</body></html>"
+
if test -n "$died"; then
echo "Some commands failed"
exit 1
echo " Trying variant $variant for benchmark $bench"
echo "---------------------------------------------------------"
git diff-index --quiet HEAD || {
- echo "Cannot run benches on a dirty working directory."
- echo "Please commit or stash your modifications and relaunch the command."
- exit 1
+ die "Cannot run benches on a dirty working directory."
+ die "Please commit or stash your modifications and relaunch the command."
+ return
}
git am $curr_rev || {
- echo "Error when applying patch $curr_rev"
- git am --abort;
- exit 1;
+ die "Error when applying patch $curr_rev"
+ git am --abort
+ return
}
if [ "$need_bootstrap" = true ]; then
prepare_compiler
bench=$1
shift;
- git diff-index --quiet HEAD || {
- echo "Cannot run benches on a dirty working directory."
- echo "Please commit or stash your modifications and relaunch the command."
- exit 1
- }
-
head=`git rev-parse HEAD`
variant="HEAD"
need_plot=true
}
main "$@";
+
+if test -n "$died"; then
+ echo "Some commands failed"
+ exit 1
+fi
+exit 0