]> granicus.if.org Git - json-c/commitdiff
Display a bit of info about what exactly we're benchmarking.
authorEric Haszlakiewicz <erh+git@nimenees.com>
Mon, 11 May 2020 03:03:43 +0000 (03:03 +0000)
committerEric Haszlakiewicz <erh+git@nimenees.com>
Mon, 11 May 2020 03:05:20 +0000 (03:05 +0000)
bench/jc-bench.sh

index 2cca1f945aa1f0b2f76c250975df712135f2152e..06a0242afd54afe1c2783421e3252013b5aaa92c 100755 (executable)
@@ -94,6 +94,7 @@ if [ ! -z "$after_arg" -a -d "$after_arg" ] ; then
        # Use provided directory
        after_src_dir="$after_arg"
        after_commit=
+       echo "Using provided directory [$after_arg] as 'after'"
 else
        _commit=
        if [ ! -z "$after_arg" ] ; then
@@ -103,11 +104,13 @@ else
        if [ ! -z "$_commit" ] ;then
                after_src_dir=  # i.e. current tree
                after_commit="$_commit"
+               echo "Using provided commit [$after_arg => $_commit] as 'after'"
        else
                # Local changes in current working directory
                # ${cur_branch}
                after_src_dir=$TOP
                after_commit=
+               echo "Using local changes in $TOP as 'after'"
        fi
 fi
 
@@ -116,6 +119,7 @@ if [ ! -z "$before_arg" -a -d "$before_arg" ] ; then
        # Use provided directory
        before_src_dir="$before_arg"
        before_commit=
+       echo "Using provided directory [$before_arg] as 'before'"
 else
        _commit=
        if [ ! -z "$before_arg" ] ; then
@@ -125,12 +129,14 @@ else
        if [ ! -z "$_commit" ] ;then
                before_src_dir=  # i.e. current tree
                before_commit="$_commit"
+               echo "Using provided commit [$before_arg => $_commit] as 'before'"
        else
                # Use origin/${cur_branch}, if different from ${after_commit}
                _cur_branch=$(git rev-parse --abbrev-ref HEAD)
                _commit=
                if [ ! -z "${_cur_branch}" ] ; then
                        _commit=$(git rev-parse --verify "origin/${_cur_branch}")
+                       echo "Using origin/${_cur_branch} [$_commit] as 'before'"
                fi
                if [ "$_commit" = "${after_commit}" ] ; then
                        _commit=
@@ -144,9 +150,12 @@ else
                # Use previous release
                before_src_dir=  # i.e. current tree
                before_commit="$(git tag | sort | tail -1)"
+               echo "Using previous release [$before_commit] as 'before'"
        fi
 fi
 
+echo
+
 compile_benchmark()
 {
        local bname=$1
@@ -205,6 +214,8 @@ compile_benchmark()
 # XXX TODO: name "after" and "before" uniquely using the dir & commit
 
 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 "before" "${before_src_dir}" "${before_commit}"
 fi