Skip to content

Commit

Permalink
Update benchmarks to use --quiet
Browse files Browse the repository at this point in the history
  • Loading branch information
lilith committed Apr 23, 2020
1 parent b6fec50 commit c5b9564
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docker/imageflow_bench_ubuntu20/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ RUN cargo install dssim
RUN cd /home/imageflow \
&& git clone https://github.com/imazen/imageflow \
&& cd /home/imageflow/imageflow \
&& git checkout v1.3.2-rc32 \
&& git checkout v1.3.3-rc33 \
&& TARGET_CPU=haswell cargo build -p imageflow_tool_lib --release \
&& mkdir $HOME/bin \
&& cp target/release/imageflow_tool $HOME/bin/imageflow_tool \
Expand Down
21 changes: 11 additions & 10 deletions docker/imageflow_bench_ubuntu20/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cd bench_in
if [[ "$1" == "thumbnail" ]]; then
# shellcheck disable=SC2016
hyperfine --export-markdown results.md --warmup 1 \
'parallel "$HOME/bin/imageflow_tool v0.1/ir4 --in {} --out ../bench_out/{.}_200x200.jpg --command width=200&height=200&quality=90" ::: *.jpg' \
'parallel "$HOME/bin/imageflow_tool v0.1/ir4 --in {} --quiet --out ../bench_out/{.}_200x200.jpg --command width=200&height=200&mode=max&quality=100" ::: *.jpg' \
'parallel "vipsthumbnail --linear --size=200x200 --output=../bench_out/{.}_vips_200x200.jpg[Q=90,strip] {}" ::: *.jpg' \
'parallel "gm convert {} -set colorspace sRGB -colorspace RGB -filter Mitchell -resize 200x200 -colorspace sRGB -quality 90 ../bench_out/{.}_gm_200x200.jpg" ::: *.jpg' \
'parallel "convert {} -set colorspace sRGB -colorspace RGB -filter Robidoux -resize 200x200 -colorspace sRGB -quality 90 ../bench_out/{.}_magick_200x200.jpg" ::: *.jpg'
Expand All @@ -36,29 +36,30 @@ fi
if [[ "$1" == "downscale" ]]; then
# shellcheck disable=SC2016
hyperfine --export-markdown results.md --warmup 1 \
'parallel "$HOME/bin/imageflow_tool v0.1/ir4 --in {} --out ../bench_out/{.}_2000x2000.jpg --command width=2000&height=2000&quality=90" ::: *.jpg' \
'parallel "$HOME/bin/imageflow_tool v0.1/ir4 --in {} --quiet --out ../bench_out/{.}_2000x2000.jpg --command width=2000&height=2000&mode=max&quality=90" ::: *.jpg' \
'parallel "vipsthumbnail --linear --size=2000x2000 --output=../bench_out/{.}_vips_2000x2000.jpg[Q=90] {}" ::: *.jpg' \
'parallel "gm convert {} -set colorspace sRGB -colorspace RGB -filter Mitchell -resize 2000x2000 -colorspace sRGB -quality 90 ../bench_out/{.}_gm_2000x2000.jpg" ::: *.jpg' \
'parallel "convert {} -set colorspace sRGB -colorspace RGB -filter Robidoux -resize 2000x2000 -colorspace sRGB -quality 90 ../bench_out/{.}_magick_2000x2000.jpg" ::: *.jpg'

# Can't get graphicsmagick to work
# 'parallel --show-output "gm convert {} -set colorspace sRGB -colorspace RGB -filter Mitchell -resize 2000x2000 -colorspace sRGB -quality 90 ../bench_out/{.}_gm_2000x2000.jpg" ::: *.jpg' \
echo "=============== Results in Markdown format ======================"
cat results.md
echo "================================================================="
fi

if [[ "$1" == "jpegsize" ]]; then

"$HOME/bin/imageflow_tool" v0.1/ir4 --in c1.jpg --out ../bench_out/imageflow_2000x2000.jpg --command "width=2000&height=2000&mode=max&quality=89" 1>/dev/null
"$HOME/bin/imageflow_tool" v0.1/ir4 --quiet --in c1.jpg --out ../bench_out/imageflow_2000x2000.jpg --command "width=2000&height=2000&mode=max&quality=89"
vipsthumbnail --linear --size=2000x2000 --output=../bench_out/vips_2000x2000.jpg[Q=89,strip,optimize-coding] c1.jpg
convert c1.jpg -set colorspace sRGB -colorspace RGB -filter Robidoux -resize 2000x2000 -colorspace sRGB -quality 89 ../bench_out/magick_2000x2000.jpg

"$HOME/bin/imageflow_tool" v0.1/ir4 --in c1.jpg --out ../bench_out/imageflow_reference_2000x2000.png --command "width=2000&height=2000&mode=max&format=png" 1>/dev/null
"$HOME/bin/imageflow_tool" v0.1/ir4 --quiet --in c1.jpg --out ../bench_out/imageflow_reference_2000x2000.png --command "width=2000&height=2000&mode=max&format=png"
vipsthumbnail --linear --size=2000x2000 --output=../bench_out/vips_reference_2000x2000.png c1.jpg
convert c1.jpg -set colorspace sRGB -colorspace RGB -filter Robidoux -resize 2000x2000 -colorspace sRGB ../bench_out/magick_reference_2000x2000.png

"$HOME/bin/imageflow_tool" v0.1/ir4 --in ../bench_out/imageflow_2000x2000.jpg --out ../bench_out/imageflow_2000x2000.png --command "format=png" 1>/dev/null
"$HOME/bin/imageflow_tool" v0.1/ir4 --in ../bench_out/vips_2000x2000.jpg --out ../bench_out/vips_2000x2000.png --command "format=png" 1>/dev/null
"$HOME/bin/imageflow_tool" v0.1/ir4 --in ../bench_out/magick_2000x2000.jpg --out ../bench_out/magick_2000x2000.png --command "format=png" 1>/dev/null
"$HOME/bin/imageflow_tool" v0.1/ir4 --quiet --in ../bench_out/imageflow_2000x2000.jpg --out ../bench_out/imageflow_2000x2000.png --command "format=png"
"$HOME/bin/imageflow_tool" v0.1/ir4 --quiet --in ../bench_out/vips_2000x2000.jpg --out ../bench_out/vips_2000x2000.png --command "format=png"
"$HOME/bin/imageflow_tool" v0.1/ir4 --quiet --in ../bench_out/magick_2000x2000.jpg --out ../bench_out/magick_2000x2000.png --command "format=png"

echo "=============== DSSIM relative to imageflow reference (lower is better) ======================"
dssim ../bench_out/imageflow_reference_2000x2000.png ../bench_out/imageflow_2000x2000.png
Expand All @@ -75,8 +76,8 @@ if [[ "$1" == "jpegsize" ]]; then
dssim ../bench_out/magick_reference_2000x2000.png ../bench_out/vips_2000x2000.png
dssim ../bench_out/magick_reference_2000x2000.png ../bench_out/magick_2000x2000.png

"$HOME/bin/imageflow_tool" v0.1/ir4 --in c1.jpg --out ../bench_out/imageflow_idct_scaling_2000x2000.png --command "width=2000&height=2000&mode=max&format=png" 1>/dev/null
"$HOME/bin/imageflow_tool" v0.1/ir4 --in c1.jpg --out ../bench_out/imageflow_no_idct_scaling_2000x2000.png --command "width=2000&height=2000&mode=max&format=png&decoder.min_precise_scaling_ratio=100" 1>/dev/null
"$HOME/bin/imageflow_tool" v0.1/ir4 --quiet --in c1.jpg --out ../bench_out/imageflow_idct_scaling_2000x2000.png --command "width=2000&height=2000&mode=max&format=png"
"$HOME/bin/imageflow_tool" v0.1/ir4 --quiet --in c1.jpg --out ../bench_out/imageflow_no_idct_scaling_2000x2000.png --command "width=2000&height=2000&mode=max&format=png&decoder.min_precise_scaling_ratio=100"

echo "=============== DSSIM with linear IDCT scaling turned on vs. no IDCT scaling ======================"
dssim ../bench_out/imageflow_no_idct_scaling_2000x2000.png ../bench_out/imageflow_idct_scaling_2000x2000.png
Expand Down

1 comment on commit c5b9564

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New misspellings found, please review:

  • esults
  • graphicsmagick
  • jpegsize
  • queryquiet
To accept these changes, run the following commands
remove_obsolete_words=$(mktemp)
echo '#!/usr/bin/perl -ni
my $re=join "|", qw('"
jsoref
megapixels
"');
next if /^($re)(?:$| .*)/;
print;' > $remove_obsolete_words
chmod +x $remove_obsolete_words
for file in .github/actions/spell-check/whitelist/42f15d0ed3748dd6a1b8c1f026d297f0625fb5eb.txt .github/actions/spell-check/whitelist/whitelist.txt; do $remove_obsolete_words $file; done
rm $remove_obsolete_words
(
echo "
esults
graphicsmagick
jpegsize
queryquiet
"
) | sort -u -f | perl -ne 'next unless /./; print' > new_whitelist.txt && mv new_whitelist.txt '.github/actions/spell-check/whitelist/c5b95641888e2ab165141518065246c44002e236.txt'

Please sign in to comment.