Major performance drop

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
sireeshala
Posts: 38
Joined: 2013-09-27T04:00:05-07:00
Authentication code: 6789

Major performance drop

Post by sireeshala »

Hi ,
I observed a huge performance drop when i started upgrading from 6.8.2-4.
6.8.2-4 --- 1440 pages/hour
6.8.7-9 ---- 564 pages/hour
Almost seen a drop above 50 %
Even i tried with the latest version 6.9.0.0, still its behaving the same , there is no improvements .
Can i know why the performance drop is happened and is there any alternative to achieve the performance reported by 6.8.2-4?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Major performance drop

Post by dlemstra »

Can you tell us what you are doing? We need to know how you are using ImageMagick before we can provide you with an answer. And what platform are you on?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Major performance drop

Post by glennrp »

That's roughly what would happen if you upgraded from a Q8 build to a Q16 build.

What do you get when you run "convert | head -2" on your fast version and on your slow version?
sireeshala
Posts: 38
Joined: 2013-09-27T04:00:05-07:00
Authentication code: 6789

Re: Major performance drop

Post by sireeshala »

Both are Q16 builds there is no difference
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Major performance drop

Post by fmw42 »

What is the exact command that you are using to show the performance drop? What is your platform? Do you have OpenMP enabled (with two or more threads) in one and not the other. What exactly do you get from convert -version on both systems?
sireeshala
Posts: 38
Joined: 2013-09-27T04:00:05-07:00
Authentication code: 6789

Re: Major performance drop

Post by sireeshala »

Hi thanks for the reply ,
here are the deraills mentioned .

Image image;
image.read( "case.jpg" );
image.magick("TIFF");
image.compressType(Group4Compression);
image.type(BilevelType);
image.write("case_1.tiff");

For some images even i use resampling ,and resize options available .

for version details i attached the screen shots
Image
Image
sireeshala
Posts: 38
Joined: 2013-09-27T04:00:05-07:00
Authentication code: 6789

Re: Major performance drop

Post by sireeshala »

User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Major performance drop

Post by fmw42 »

Please answer the previous questions.
What is your platform? Do you have OpenMP enabled (with two or more threads) in one and not the other. What exactly do you get from convert -version on both systems?
Do you see the same speed drop using the command line?
sireeshala
Posts: 38
Joined: 2013-09-27T04:00:05-07:00
Authentication code: 6789

Re: Major performance drop

Post by sireeshala »

I am working on Wondows 7 there are no threads for both versions .
The result of first version is
>convert.exe -version
Version: ImageMagick 6.8.2-4 2013-02-03 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib freetype jng jp2 jpeg lcms lzma png ps tiff x xml zlib

And the later one is
>convert.exe -version
Version: ImageMagick 6.8.7-9 Q16 x86 2013-11-28 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib freetype jbig jng jp2 jpeg lcms lqr pangocairo png ps tiff webp
xml zlib

yes I have seen same drop
sireeshala
Posts: 38
Joined: 2013-09-27T04:00:05-07:00
Authentication code: 6789

Re: Major performance drop

Post by sireeshala »

are there any specific reasons to had this performance drop from version 6.8.2-4 to 6.8.7-9?
sireeshala
Posts: 38
Joined: 2013-09-27T04:00:05-07:00
Authentication code: 6789

Re: Major performance drop

Post by sireeshala »

More specifically i have tested with most of the versions available in between 6.8.2 and 6.8.7-9.
In Exact i found the performance drop after 6.8.6-10 .
I have gone through the change log but nothing helped to solve my issue .
Are there any one has any idea what changes after the version 6.8.6-10 causes the performance drop?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Major performance drop

Post by fmw42 »

Possibly related to viewtopic.php?f=4&t=21269, but that is just a guess
sireeshala
Posts: 38
Joined: 2013-09-27T04:00:05-07:00
Authentication code: 6789

Re: Major performance drop

Post by sireeshala »

I Can still narrow down the issue .
Exactly performance drop was found After 6.8.7-8 Means the drop starts from 6.8.7-9
We have gone through the logs and found out that the performance problem may caused by the following modification with rev. 13858+13859 in MagickCore/attribute.c

The modification causes these overhead steps if a b/w image is coded as G.4 TIFF:
• The image is converted from b/w to grayscale
• The grayscale image is normalized (enhances the contrast of a color image by mapping the darkest 2% of all pixel to black and the brightest 1% to white according to comment)
• The grayscale image is converted back to b/w

We observed the drop for b/w(black and white) and grayscale
attribute.patch gives the required modifications to avoid the over heads caused.

https://www.dropbox.com/s/isb3uhh9glbdg ... ute.c?dl=0
https://www.dropbox.com/s/2twn1xjxv8l5f ... patch?dl=0
Post Reply