Browse Source

Display a bit of info about what exactly we're benchmarking.

tags/json-c-0.15-20200726
Eric Haszlakiewicz 5 years ago
parent
commit
2e71fe0963
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      bench/jc-bench.sh

+ 11
- 0
bench/jc-bench.sh View File

@@ -94,6 +94,7 @@ if [ ! -z "$after_arg" -a -d "$after_arg" ] ; then
# Use provided directory # Use provided directory
after_src_dir="$after_arg" after_src_dir="$after_arg"
after_commit= after_commit=
echo "Using provided directory [$after_arg] as 'after'"
else else
_commit= _commit=
if [ ! -z "$after_arg" ] ; then if [ ! -z "$after_arg" ] ; then
@@ -103,11 +104,13 @@ else
if [ ! -z "$_commit" ] ;then if [ ! -z "$_commit" ] ;then
after_src_dir= # i.e. current tree after_src_dir= # i.e. current tree
after_commit="$_commit" after_commit="$_commit"
echo "Using provided commit [$after_arg => $_commit] as 'after'"
else else
# Local changes in current working directory # Local changes in current working directory
# ${cur_branch} # ${cur_branch}
after_src_dir=$TOP after_src_dir=$TOP
after_commit= after_commit=
echo "Using local changes in $TOP as 'after'"
fi fi
fi fi


@@ -116,6 +119,7 @@ if [ ! -z "$before_arg" -a -d "$before_arg" ] ; then
# Use provided directory # Use provided directory
before_src_dir="$before_arg" before_src_dir="$before_arg"
before_commit= before_commit=
echo "Using provided directory [$before_arg] as 'before'"
else else
_commit= _commit=
if [ ! -z "$before_arg" ] ; then if [ ! -z "$before_arg" ] ; then
@@ -125,12 +129,14 @@ else
if [ ! -z "$_commit" ] ;then if [ ! -z "$_commit" ] ;then
before_src_dir= # i.e. current tree before_src_dir= # i.e. current tree
before_commit="$_commit" before_commit="$_commit"
echo "Using provided commit [$before_arg => $_commit] as 'before'"
else else
# Use origin/${cur_branch}, if different from ${after_commit} # Use origin/${cur_branch}, if different from ${after_commit}
_cur_branch=$(git rev-parse --abbrev-ref HEAD) _cur_branch=$(git rev-parse --abbrev-ref HEAD)
_commit= _commit=
if [ ! -z "${_cur_branch}" ] ; then if [ ! -z "${_cur_branch}" ] ; then
_commit=$(git rev-parse --verify "origin/${_cur_branch}") _commit=$(git rev-parse --verify "origin/${_cur_branch}")
echo "Using origin/${_cur_branch} [$_commit] as 'before'"
fi fi
if [ "$_commit" = "${after_commit}" ] ; then if [ "$_commit" = "${after_commit}" ] ; then
_commit= _commit=
@@ -144,9 +150,12 @@ else
# Use previous release # Use previous release
before_src_dir= # i.e. current tree before_src_dir= # i.e. current tree
before_commit="$(git tag | sort | tail -1)" before_commit="$(git tag | sort | tail -1)"
echo "Using previous release [$before_commit] as 'before'"
fi fi
fi fi


echo

compile_benchmark() compile_benchmark()
{ {
local bname=$1 local bname=$1
@@ -205,6 +214,8 @@ compile_benchmark()
# XXX TODO: name "after" and "before" uniquely using the dir & commit # XXX TODO: name "after" and "before" uniquely using the dir & commit


if [ $do_all -ne 0 -o $do_build -ne 0 ] ; then if [ $do_all -ne 0 -o $do_build -ne 0 ] ; then
sleep 5 # Wait slightly, to allow the human to read the message
# about what exactly we're doing to benchmark.
compile_benchmark "after" "${after_src_dir}" "${after_commit}" compile_benchmark "after" "${after_src_dir}" "${after_commit}"
compile_benchmark "before" "${before_src_dir}" "${before_commit}" compile_benchmark "before" "${before_src_dir}" "${before_commit}"
fi fi


Loading…
Cancel
Save