Page 1 of 1

IM7.0.2-9 is not using available resources

Posted: 2016-08-22T01:55:43-07:00
by mikmach
This is similar to problem reported (and solved for IM6) here:

viewtopic.php?f=1&t=26992

IM7 is not using available resources. When processing big file magick uses 1 thread, 8 processes and on average about 8% of CPU (as reported by Windows resource monitor).

IM6 processing the same command (profile conversion, layers operations) uses 12 threads, up to 100 processes and peaks at 100% CPU usage (which is good - in this case more is better).

IM7 (with default settings):
[/j/prep-ss/pap/2016-08-18-test/im6/raw]$ magick -version
Version: ImageMagick 7.0.2-9 Q16 x64 2016-08-14 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC HDRI
Delegates (built-in): bzlib cairo flif freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib

IM6 (normal config without special preparation for big files and messing with resources):
[/j/prep-ss/pap/2016-08-18]$ convert -version
Version: ImageMagick 6.9.3-5 Q8 x64 2016-02-20 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib

Re: IM7.0.2-9 is not using available resources

Posted: 2016-08-22T02:00:41-07:00
by snibgo
Your v7 doesn't have OpenMP, which I think it needs for multi-threading.

Re: IM7.0.2-9 is not using available resources

Posted: 2016-08-22T03:24:03-07:00
by mikmach
Yes, thank you. That was it.

Although even when IM7 uses all 12 threads it is significantly slower than IM6. The same task (processing of 10 big files) IM6 did in 7m:53s while IM7 did it in 16m:51s.

Re: IM7.0.2-9 is not using available resources

Posted: 2016-08-22T04:10:10-07:00
by snibgo
Half the speed? Yuck. Can you show what command or code you were using?

EDIT: I've just noticed, your v6 is Q8 integer, but your v7 is Q16 HDRI. That probably explains the difference in speed.

Re: IM7.0.2-9 is not using available resources

Posted: 2016-08-22T06:05:05-07:00
by mikmach
In my past experiences Q-change consequence was significant change in RAM usage but minor in execution time but I will retest it.

Re: IM7.0.2-9 is not using available resources

Posted: 2016-08-24T03:35:40-07:00
by mikmach
Retested with Q8 and results are better but still significantly slower than IM6:

IM6 Q8: 7m 53s / 8m 04s
IM7 Q16: 16m 51s
IM7 Q8: 12m 49s / 12m 53s

Command is

magick $i -quiet -profile adobeRGB.icc \
\( +clone -gaussian-blur 6x3 \) -compose Colorize -composite \
\( -clone 0 -gaussian-blur 0x1.5 \) \
\( -clone 0 -clone 1 +swap -compose mathematics -set option:compose:args "0,1,-1,0.5" -composite \) \
\( -clone 0 -clone 2 -compose overlay -composite \) -delete 0-2 ..\\tiff\\$i

Files are LZW'd TIFF files up to 14000x14000 pixels.

Re: IM7.0.2-9 is not using available resources

Posted: 2016-08-24T09:34:54-07:00
by fmw42
You can speed things up if you use -blur rather than -gaussian-blur. Also you can run faster if you disable the default HDRI mode in IM 7, so that you are comparing to IM 6 which does not have HDRI by default.

Re: IM7.0.2-9 is not using available resources

Posted: 2016-08-24T11:55:20-07:00
by magick
Something in the pipeline is much slower in IMv7. Most of the options are commensurate in speed between IMv7 and IMv6 when tested as Q16, non-HDRI. We will isolate the slowdown and add a patch in the next week or so.

Re: IM7.0.2-9 is not using available resources

Posted: 2016-08-24T12:51:08-07:00
by mikmach
@Fred

After snibgo comment I used non-HDRI version of Q8 so this is not the case. I would prefer stay with gaussian. IMO it generates better, smoother effects.

BTW - thank you very much for highpass filter used in this command :)

@magick

Thank you.