Writing Gif takes huge time.
Posted: 2013-10-25T12:19:03-07:00
Hello,
We are trying to convert gif to a gif but bigger images just take huge time(~10-12 sec to write to shared mem). I wanted to confirm if it normal. We have a timeout of 10sec aroud resize for ourc lients but we have fallen into situation where even 10 sec is not enough. Is there any benchmarking done over gif images which I can refer in order to deefinea proper timeout value?
Here is some information:
Writing to /dev/shm is taking as much as 11 sec :
TotalTimeResize:=LoadLib,0,,readFile,0,resize,93.7402267,Unsharp,0,WriteFile,11289.8281
ImageMagick version :
Version: ImageMagick 6.8.6-6 2013-07-23 Q16 http://www.imagemagick.org
Code for timer and sequence of operations :
1) Resize
2) Apply watermark
3)Apply sharpening
4) Write to shared memory (/dev/shm)
Is the above normal for Gif conversions and writes. I have seen taking it more time through command line too. Is there any optimizations which we can use?
Let me know if I need to provide you with images. Typical image would be somewhere around 1MB and output resized image to say 800pixels is around ~450kb.
Thanks
G
We are trying to convert gif to a gif but bigger images just take huge time(~10-12 sec to write to shared mem). I wanted to confirm if it normal. We have a timeout of 10sec aroud resize for ourc lients but we have fallen into situation where even 10 sec is not enough. Is there any benchmarking done over gif images which I can refer in order to deefinea proper timeout value?
Here is some information:
Writing to /dev/shm is taking as much as 11 sec :
TotalTimeResize:=LoadLib,0,,readFile,0,resize,93.7402267,Unsharp,0,WriteFile,11289.8281
ImageMagick version :
Version: ImageMagick 6.8.6-6 2013-07-23 Q16 http://www.imagemagick.org
Code for timer and sequence of operations :
1) Resize
Code: Select all
Image image_;
image_.resize( boost::lexical_cast<string>(context.getTargetWidth())+"x"+ boost::lexical_cast<string>(context.getTargetHeight()));
Code: Select all
image_.composite(imageCameraIcon,Magick::SouthEastGravity,Magick::ModulateCompositeOp);
image_.annotate(sn, SouthWestGravity);
Code: Select all
image_.unsharpmask(0.8,0.5,1.2,0.05);
Code: Select all
gettimeofday(&tim1, NULL);
double tWriteStart=tim1.tv_sec+(tim1.tv_usec/1000000.0);
image_.write(fileName_.c_str());
gettimeofday(&tim1, NULL);
double tWriteEnd=tim1.tv_sec+(tim1.tv_usec/1000000.0);
float tWriteFile = (tWriteEnd - tWriteStart)*1000;
std::ostringstream totalTime;
totalTime <<"WriteFile," << boost::lexical_cast<std::string>(tWriteFile);
Let me know if I need to provide you with images. Typical image would be somewhere around 1MB and output resized image to say 800pixels is around ~450kb.
Thanks
G