7 # This aborts the bisection immediately
13 bisect_head=$(git rev-parse --verify BISECT_HEAD) || die "Failed to find BISECT_HEAD ref"
15 script_number=$(echo "$script" | sed -e "s/^p\([0-9]*\).*\$/\1/") || die "Failed to get script number for '$script'"
17 oldtime=$(cat "$info_dir/oldtime") || die "Failed to access '$info_dir/oldtime'"
18 newtime=$(cat "$info_dir/newtime") || die "Failed to access '$info_dir/newtime'"
20 cd t/perf || die "Failed to cd into 't/perf'"
22 result_file="$info_dir/perf_${script_number}_${bisect_head}_results.txt"
24 GIT_PERF_DIRS_OR_REVS="$bisect_head"
25 export GIT_PERF_DIRS_OR_REVS
27 ./run "$script" >"$result_file" 2>&1 || die "Failed to run perf test '$script'"
29 rtime=$(sed -n "s/^$script_number\.$test_number:.*\([0-9]\+\.[0-9]\+\)(.*).*\$/\1/p" "$result_file")
31 echo "newtime: $newtime"
33 echo "oldtime: $oldtime"
35 # Compare ($newtime - $rtime) with ($rtime - $oldtime)
36 # Times are decimal number, not integers
38 if test $(echo "$newtime" "$rtime" "$oldtime" | awk '{ print ($1 - $2 > $2 - $3) }') = 1
40 # Current commit is considered "good/old"
41 echo "$rtime" >"$info_dir/oldtime"
44 # Current commit is considered "bad/new"
45 echo "$rtime" >"$info_dir/newtime"