Last active
September 11, 2024 07:15
-
-
Save Benitoite/470633de60550fb95e8776c424fe4eaf to your computer and use it in GitHub Desktop.
RawTherapee performance timer for MacOS zsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
intel: | |
git clone https://github.com/Benitoite/raw-test ./raw-test ; num=$(sysctl -n hw.physicalcpu) ; sockets=1 ; total_threads=$((num * sockets)) ; name=$(system_profiler SPHardwareDataType | grep 'Processor Name:' | sed 's/Processor Name: *//' | cut -c 7-) ; mhz=$(system_profiler SPHardwareDataType | grep 'Speed:' | awk '{print $3}') ; proc=$(cat ./AboutThisBuild.txt | grep 'Processor') ; echo "\`\`\`" ; echo "================================" ; echo "Available threads = $total_threads / CPU = $name / $mhz GHz / Target = $proc" ; for (( threads = 2; threads <= total_threads; threads *= 2 )); do export OMP_NUM_THREADS=$threads ; total_time=0.0 ; n=5 ; for file in typewriter.CR2 naturalbridges.CR2 beachcabin.ARW; do time_sum=0.0 ; for (( i = 0; i < n; i++ )); do start=$(( $(date +%s%N)/1000000 )) ; rawtherapee-cli -j -s -Y -c ./raw-test/$file &> /dev/null ; finished=$(( $(date +%s%N) / 1000000 )) ; time_sum=$(( $time_sum + $finished - $start )) ; done ; avg_time=$(( $time_sum / $n )) ; total_time=$(( $total_time + $avg_time )) ; done ; echo "$(printf '%.0f\n' "$total_time") total milliseconds elapsed (average of $n runs) using OMP_NUM_THREADS = $threads" ; done ; echo "================================" ; echo "\`\`\`" | |
arm64: | |
git clone https://github.com/Benitoite/raw-test ./raw-test ; num=$(sysctl -n hw.physicalcpu) ; sockets=1 ; total_threads=$((num * sockets)) ; name=$(system_profiler SPHardwareDataType | grep 'Chip:' | sed 's/Chip: *//' | cut -c 7-) ; mhz=$(i=0 ; total=0 ; for freq in $(sudo timeout 1s powermetrics -i 1 | grep 'P-Cluster HW active frequency:' | sed 's/P-Cluster HW active frequency:*//' | cut -c2-6) ; do echo $(( total+=$freq )) > /dev/null ; i+=1 ; done ; ave=$(( $total/$i )) ; echo $ave | grep -oE '^\s*[0-9]+') ; proc=$(cat ./AboutThisBuild.txt | grep 'Processor') ; echo "\`\`\`" ; echo "================================" ; echo "Available threads = $total_threads / CPU = $name / $mhz MHz / Target = $proc" ; for (( threads = 2; threads <= total_threads; threads *= 2 )); do export OMP_NUM_THREADS=$threads ; total_time=0.0 ; n=5 ; for file in typewriter.CR2 naturalbridges.CR2 beachcabin.ARW; do time_sum=0.0 ; for (( i = 0; i < n; i++ )); do start=$(( $(date +%s%N)/1000000 )) ; rawtherapee-cli -j -s -Y -c ./raw-test/$file &> /dev/null ; finished=$(( $(date +%s%N) / 1000000 )) ; time_sum=$(( $time_sum + $finished - $start )) ; done ; avg_time=$(( $time_sum / $n )) ; total_time=$(( $total_time + $avg_time )) ; done ; echo "$(printf '%.0f\n' "$total_time") total milliseconds elapsed (average of $n runs) using OMP_NUM_THREADS = $threads" ; done ; echo "================================" ; echo "\`\`\`" |
LTO=ON
================================
Available threads = 8 / CPU = Apple M1 / 3075 MHz / Target = Processor: arm64
38740 total milliseconds elapsed (average of 5 runs) using OMP_NUM_THREADS = 2
25136 total milliseconds elapsed (average of 5 runs) using OMP_NUM_THREADS = 4
19227 total milliseconds elapsed (average of 5 runs) using OMP_NUM_THREADS = 8
================================
LTO=OFF
================================
Available threads = 8 / CPU = Apple M1 / 2752 MHz / Target = Processor: arm64
36620 total milliseconds elapsed (average of 5 runs) using OMP_NUM_THREADS = 2
22912 total milliseconds elapsed (average of 5 runs) using OMP_NUM_THREADS = 4
18350 total milliseconds elapsed (average of 5 runs) using OMP_NUM_THREADS = 8
================================
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-DWITH_LTO="OFF"