Updates and fixes to benchmarkRT

This commit is contained in:
DrSlony
2012-05-04 23:11:19 +01:00
parent e2647a0f19
commit 76a9421372

View File

@@ -7,7 +7,7 @@
revision="tip" revision="tip"
inFile='http://rawtherapee.com/shared/test_images/colorspace_flowers.pef' inFile='http://rawtherapee.com/shared/test_images/colorspace_flowers.pef'
sidecarDefault=("neutral.pp3" "default.pp3") sidecarDefault=("Neutral.pp3" "Default.pp3")
buildType="release" buildType="release"
branch="default" branch="default"
rtExe="rawtherapee" rtExe="rawtherapee"
@@ -60,7 +60,7 @@ Options:
which the input file must be developed. which the input file must be developed.
This can be a file on your hard drive or a url. This can be a file on your hard drive or a url.
The default behaviour if you do not use -s is to use the The default behaviour if you do not use -s is to use the
"neutral" profile. "Neutral" profile.
Examples: Examples:
Run the default benchmark (recommended) Run the default benchmark (recommended)
@@ -174,6 +174,7 @@ if [[ -n "${sidecarCustom}" ]]; then # if sidecarCustom was specified
exit 1 exit 1
} }
unset sidecarFiles # just to be sure, since custom supports only 1 file. unset sidecarFiles # just to be sure, since custom supports only 1 file.
sidecarDir=""
sidecarFiles="${sidecarCustom}" sidecarFiles="${sidecarCustom}"
fi fi
else # if sidecarCustom was not specified, use the ones in sidecarDefault else # if sidecarCustom was not specified, use the ones in sidecarDefault
@@ -181,7 +182,7 @@ else # if sidecarCustom was not specified, use the ones in sidecarDefault
for dir in "${sidecarDirs[@]}"; do for dir in "${sidecarDirs[@]}"; do
for sidecar in "${sidecarDefault[@]}"; do for sidecar in "${sidecarDefault[@]}"; do
# echo "Checking for ${sidecar} in ${dir}" # echo "Checking for ${sidecar} in ${dir}"
if [[ -f "${dir}/${sidecar}" ]]; then if [[ -f "${dir}${sidecar}" ]]; then
sidecarDir="$dir" sidecarDir="$dir"
found="true" found="true"
# echo "Found sidecar ${sidecar} in ${sidecarDir[@]}" # echo "Found sidecar ${sidecar} in ${sidecarDir[@]}"
@@ -189,47 +190,63 @@ else # if sidecarCustom was not specified, use the ones in sidecarDefault
done done
[[ -n $found ]] && break [[ -n $found ]] && break
done done
# if the loop above did not find a neutral.pp3 anywhere, then we download one to $tmpDir # if the loop above did not find a Neutral.pp3 anywhere, then we download one to $tmpDir
[[ -z $found ]] && { [[ -z $found ]] && {
wget -c --trust-server-names "http://code.google.com/p/rawtherapee/source/browse/rtdata/profiles/neutral.pp3" "http://code.google.com/p/rawtherapee/source/browse/rtdata/profiles/default.pp3" wget -c --trust-server-names "http://code.google.com/p/rawtherapee/source/browse/rtdata/profiles/Neutral.pp3" "http://code.google.com/p/rawtherapee/source/browse/rtdata/profiles/Default.pp3"
sidecarDir="$tmpDir" sidecarDir="${tmpDir}/"
} }
sidecarFiles=("${sidecarDefault[@]}") sidecarFiles=("${sidecarDefault[@]}")
fi fi
rtExeDirs=("${customExeDir}" "${tmpDir}/rt_${branch}_${buildType}" "$HOME/rt_${branch}_${buildType}" "${repo}/rt_${branch}_${buildType}" "${repo}/release" "$HOME/rawtherapee/") rtExeDirs=("${customExeDir}" "${tmpDir}/rt_${branch}_${buildType}" "$HOME/rt_${branch}_${buildType}" "${repo}/rt_${branch}_${buildType}" "${repo}/release" "$HOME/rawtherapee/")
for rtExeDir in "${rtExeDirs}"; do for rtExeDir in "${rtExeDirs[@]}"; do
#if [[ -n "$customExe" # test below prevents looking for RT in empty rtExeDir variables, so the printf doesn't report "Checking for RawTherapee executable in " with no dir.
[[ $rtExeDir ]] && {
if [[ -x "${rtExeDir}/${rtExe}" ]]; then if [[ -x "${rtExeDir}/${rtExe}" ]]; then
printf "%s\n" "Using RawTherapee executable: ${rtExeDir}/${rtExe}"
break break
else else
printf "%s\n" "Could not find the rawtherapee executable. Either re-run this script using the -e flag, or continue to have this script clone the source code repository and compile RawTherapee for you. For this to work, you need to have the correct dependencies installed - see http://rawtherapee.com/forum/viewtopic.php?f=10&t=3001#p22213" | fold -s printf "%s\n" "Checking for RawTherapee executable in $rtExeDir"
echo fi
}
done
if [[ ! -x "${rtExeDir}/${rtExe}" ]]; then
printf "%s\n" "Could not find the RawTherapee executable. Either re-run this script using the -e flag, or continue to have this script clone the source code repository and compile RawTherapee for you. For this to work, you need to have the correct dependencies installed - see http://rawtherapee.com/forum/viewtopic.php?f=10&t=3001#p22213" | fold -s
read -p "Do you want to proceed? y/n: " YN read -p "Do you want to proceed? y/n: " YN
[[ "$YN" = y ]] && buildRT || exit 0 [[ "$YN" = y ]] && buildRT || exit 0
fi fi
done
printf "%s\n" "Benchmark of RawTherapee" printf "%s\n" "--------------------------------------------------------------------------" "" "Benchmark of RawTherapee"
uname -srvmpio printf "%s\n" "`uname -srvmpio`" ""
echo
rtATBdirs=("${tmpDir}/rt_${branch}_${buildType}" "$HOME/rt_${branch}_${buildType}" "${repo}/rt_${branch}_${buildType}" "${repo}/release" "$HOME/rawtherapee") #rtATBdirs=("${tmpDir}/rt_${branch}_${buildType}" "$HOME/rt_${branch}_${buildType}" "${repo}/rt_${branch}_${buildType}" "${repo}/release" "$HOME/rawtherapee")
for rtATBdir in "${rtATBdirs[@]}"; do #for rtATBdir in "${rtATBdirs[@]}"; do
if [[ -f "${rtATBdir}/AboutThisBuild.txt" ]]; then # if [[ -f "${rtATBdir}/AboutThisBuild.txt" ]]; then
printf "%s\n" "${rtATBdir}/AboutThisBuild.txt" # printf "%s\n" "${rtATBdir}/AboutThisBuild.txt"
cat "${rtATBdir}/AboutThisBuild.txt" # cat "${rtATBdir}/AboutThisBuild.txt"
break # break
# fi
#done
if [[ ! -f "${rtExeDir}/AboutThisBuild.txt" ]]; then
printf "%s\n" "[Could not find ${rtExeDir}/AboutThisBuild.txt]" ""
else
cat "${rtExeDir}/AboutThisBuild.txt"
fi fi
done
printf "%s\n" "Input file: ${inFileName}" printf "%s\n" "Photo: ${tmpDir}/${inFileName}"
for sidecar in "${sidecarFiles[@]}"; do
printf "%s\n" "Sidecar[s]: ${sidecarDir}${sidecar}"
done
echo
unset sidecar unset sidecar
for sidecar in "${sidecarFiles[@]}"; do for sidecar in "${sidecarFiles[@]}"; do
unset benchmark unset benchmark
for (( i=1; i<=${runs}; i++ )); do for (( i=1; i<=${runs}; i++ )); do
# printf "%s\n" "rtExe is $rtExe" "tmpDir is $tmpDir" "sidecarDir is $sidecarDir" "sidecar is $sidecar" "outFileFormat is $outFileFormat" "tmpDir is $tmpDir" "inFileName is $inFileName" # printf "%s\n" "rtExe is $rtExe" "tmpDir is $tmpDir" "sidecarDir is $sidecarDir" "sidecar is $sidecar" "outFileFormat is $outFileFormat" "tmpDir is $tmpDir" "inFileName is $inFileName"
benchmark+=("`\time -f %e "${rtExeDir}/${rtExe}" -o "$tmpDir" -p "${sidecarDir}/${sidecar}" "$outFileFormat" -Y -c "${tmpDir}/${inFileName}" 2>&1 >/dev/null`") benchmark+=("`\time -f %e "${rtExeDir}/${rtExe}" -o "$tmpDir" -p "${sidecarDir}${sidecar}" "$outFileFormat" -Y -c "${tmpDir}/${inFileName}" 2>&1 >/dev/null`")
printf "%b\n" "Benchmark ${sidecar} ${i}: ${benchmark[$i - 1]}" printf "%b\n" "Benchmark ${sidecar} ${i}: ${benchmark[$i - 1]}"
done done
avg=$( { printf "scale=2; ("; IFS="+"; printf %s "${benchmark[*]}"; echo ") / ${#benchmark[@]}"; } | bc) avg=$( { printf "scale=2; ("; IFS="+"; printf %s "${benchmark[*]}"; echo ") / ${#benchmark[@]}"; } | bc)