help!!! how to improve Magick::Image.read

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
youbinliu
Posts: 5
Joined: 2014-10-16T03:40:54-07:00
Authentication code: 6789

help!!! how to improve Magick::Image.read

Post by youbinliu »

hi,could anybody help me to fix this problem?
code like this:
blob = new(std::nothrow) Magick::Blob(image_buffer.c_str(),image_buffer.length());
img->read(*blob)

I use multi threads to process image. Now, I start 5 threads to run
when image is 5000x3000, process cpu reach 99%, and "read" cost 6s
like,when threads is more, read cost more time
how to reduce read cost time?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: help!!! how to improve Magick::Image.read

Post by dlemstra »

I think you should reduce the number of threads when you have large images or add more memory to your system. If the image cannot be loaded into the memory it will use the harddisk. This will dramatically decrease the performance.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply