Major performance problem...

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
malch
Posts: 4
Joined: 2011-05-12T11:07:35-07:00
Authentication code: 8675308

Major performance problem...

Post by malch »

I have simple Perl/ImageMagick script that runs nicely on my Windows box.

However, when run on my CentOS server the performance is horrible. Each execution requires around 120MB of memory and 2.5 seconds of CPU.

It consumes about one tenth of those resources under Windows (much more reasonable).

Any suggestions?

www:/home/malch> convert -version
Version: ImageMagick 6.7.2-9 2011-10-01 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP

I've just installed the above version; it was even worse under 6.6.9-9 which I was running previously.

#!/usr/bin/perl
$IMPATH = '/etc/httpd/fonts';
$ENV{MAGICK_CONFIGURE_PATH} = $IMPATH;
$text = "Here is the message";
$font = 'JIMMY1';
$size = 36;
use Image::Magick;
my $image = Image::Magick->new;
$image->Set(quality=>100);
$image->Set(type=>'truecolor');
$image->Set(size=>'2000x1000');
$image->ReadImage('xc:white');
$image->Annotate(x=>1000, y=>400, align=>'center', font=>$font, pointsize=>$size, fill=>'black', text=>$text);
$image->Trim();
($width, $height) = $image->Get('width', 'height');
$image->Set(type=>'truecolor');
$image->Set(magick=>'JPEG');
my $blob = $image->ImageToBlob();
undef $image;
#print "Content-Type: image/jpeg\r\n\r\n";
binmode (STDOUT);
print $blob;
exit;
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Major performance problem...

Post by magick »

Try turning off OpenMP. Rerun the configure command line script and add the --disable-openmp to the command line. After you build and install, convert -version should not list OpenMP as a feature.
malch
Posts: 4
Joined: 2011-05-12T11:07:35-07:00
Authentication code: 8675308

Re: Major performance problem...

Post by malch »

Thank you.

--disable-openmp has helped a lot.

Performance is now much more reasonable. Still looks a bit slow compared to my Windows box but this is something I can live with quite happily.
Weertolon
Posts: 1
Joined: 2011-10-09T14:13:50-07:00
Authentication code: 8675308

Re: Major performance problem...

Post by Weertolon »

And how can I speed up the performance?
GSM Booster. The solution of staggering-signals
Three Key Components Of Gsm Repeater
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Major performance problem...

Post by fmw42 »

What is your problem exactly? What command is running slow? What version of IM and platform are you running?

It is hard to tell from so little information!

Also it is generally best not to tack onto some one else's post. One should start one's own post.

Please clarify your problem and someone will likely be able to help further.
Post Reply