Hello all,
I'm having some efficiency problems with ImageMagick 6.5.0 that is built as 64bit binary on Solaris 10/08.
If I build it as 32bit binary it uses 1,9s for resizing 6.5MB image from command line with convert. The resize of the same image with 64bit binary takes 2,9s. On Fedora 64 it takes 1.5s and that's the timing I was going for. It's a quad core computer.
I'm guessing the error must be in my compile and build flags.
I'm compiling it with Sun Studio 12.
flags -xO3 -xopenmp -m64.
Crashes with -fast, -xO5 doesn't seem to make any diferrence.
Any suggestions, what Am I doing wrong?
Best regards, boza.
Solaris 10 and ImageMagick
Re: Solaris 10 and ImageMagick
In your case is the problem start-up time, the resize algorithm, OpenMP, or something specific to your processor, compiler, or OS? We have seen that OpenMP is more efficient on some architectures than others. Set the MAGICK_THREAD_LIMIT to 1 and 2 and see if that makes an improvement:
To see if startup-time is a factor, try resizing several times:
As an experiment, modify magick/resize.c and change WorkLoadFactor from 0.265 to 0.0 and then 100.0. This changes the algorithm direction from column-wise to row-wise.
You could try a different resize algorithm. Try -scale for example:
Can you post a URL to your image and the command you are using? We'll download it and runs some timing experiments on our systems.
- set MAGICK_THREAD_LIMIT=1
convert myimage.png -resize 200% myimage.jpg
To see if startup-time is a factor, try resizing several times:
- convert myimage.png -resize 200% -resize 50% -resize 200% -resize 50% -resize 200% -resize 50% myimage.jpg
As an experiment, modify magick/resize.c and change WorkLoadFactor from 0.265 to 0.0 and then 100.0. This changes the algorithm direction from column-wise to row-wise.
You could try a different resize algorithm. Try -scale for example:
- convert myimage.png -scale 200% myimage.jpg
Can you post a URL to your image and the command you are using? We'll download it and runs some timing experiments on our systems.
Re: Solaris 10 and ImageMagick
Thank you for such a quick replay.
We did some benchmarking on Solaris and we got to this results.
Scale is faster for 1 second, but still 0.6 - 0.7 slower than 32 bit build
WorkLoadFactor from 0.265 to 0.0 and then 100.0
0.0 - around 3 sec... slightly slower
100 - same as original
set MAGICK_THREAD_LIMIT=1/2 - no difference
when setting a wrong command line, eg. convert strehe.jpg -reize 640x480 strehe_small.jpg, it takes 1.5 sec to exit with an error? Possible slow start?
command line
(64 bit) convert strehe.jpg -resize 640x480 strehe_small.jpg (~ 2.8 sec)
(32 bit) convert strehe.jpg -scale 640x480 strehe_small.jpg (~ 1.7 sec)
Tested on (quadcore) Xeon E5420@2.50GHz and Core2Duo E7200@2.53GHz
configure line
./configure --prefix=/opt/im-CC CC=cc --disable-static --with-quantum-depth=8 --without-perl --without-magick-plus-plus CFLAGS="-xO5 -xtarget=native -m64 -xipo" CXX=CC
truss dump with timestamps suggests that reading of something (original image?) takes ~ 1.4 sec for 64bit build. The same reading takes 0.7 sec on 32 bit build.
Here is URL for the image http://static.kiberpipa.org/~daedalus/pic/strehe.jpg
Any other ideas?
thanks, boza
We did some benchmarking on Solaris and we got to this results.
Scale is faster for 1 second, but still 0.6 - 0.7 slower than 32 bit build
WorkLoadFactor from 0.265 to 0.0 and then 100.0
0.0 - around 3 sec... slightly slower
100 - same as original
set MAGICK_THREAD_LIMIT=1/2 - no difference
when setting a wrong command line, eg. convert strehe.jpg -reize 640x480 strehe_small.jpg, it takes 1.5 sec to exit with an error? Possible slow start?
command line
(64 bit) convert strehe.jpg -resize 640x480 strehe_small.jpg (~ 2.8 sec)
(32 bit) convert strehe.jpg -scale 640x480 strehe_small.jpg (~ 1.7 sec)
Tested on (quadcore) Xeon E5420@2.50GHz and Core2Duo E7200@2.53GHz
configure line
./configure --prefix=/opt/im-CC CC=cc --disable-static --with-quantum-depth=8 --without-perl --without-magick-plus-plus CFLAGS="-xO5 -xtarget=native -m64 -xipo" CXX=CC
truss dump with timestamps suggests that reading of something (original image?) takes ~ 1.4 sec for 64bit build. The same reading takes 0.7 sec on 32 bit build.
Here is URL for the image http://static.kiberpipa.org/~daedalus/pic/strehe.jpg
Any other ideas?
thanks, boza
Re: Solaris 10 and ImageMagick
For comparison, on our 64-bit Redhat 5.2 4-core Xeon @ 3.00GHZ with 16GB of memory we get the expected sub-second results for your image:
- -> identify -version
Version: ImageMagick 6.5.0-3 2009-03-19 Q8 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
-> zsh -c 'time convert strehe.jpg -resize 640x480 strehe_small.jpg'
convert strehe.jpg -resize 640x480 strehe_small.jpg 1.49s user 0.05s system 210% cpu 0.729 total
-> zsh -c 'time convert strehe.jpg -scale 640x480 strehe_small.jpg'
convert strehe.jpg -scale 640x480 strehe_small.jpg 0.65s user 0.03s system 100% cpu 0.689 total
Re: Solaris 10 and ImageMagick
I'll try to experiment with compile flags some more. I'm sure the problem is my build and as there is no binary for 64bit Solaris to test, I'll just have to figure out how to make it work. I'm not going to give up on IM yet.
If I get any results I'll let you now.
thanks,
Boza
If I get any results I'll let you now.
thanks,
Boza