Hi,
I've been using this version of ImageMagick library:
https://www.nuget.org/packages/Magick.NET-Q8-AnyCPU/7.0.0.8
And due to some problems we faced, I decided to make an update to the latest version (https://www.nuget.org/packages/Magick.NET-Q8-AnyCPU/7.0.6.102) and also tried out other versions prior to the latest, but it slows down my production process double time. What I am referring to in usage in the implementation in my program is: I am using it to combine layers (merge) images together in a sequence. Nothing is being changed in my code that it would require something additional. I simply want and updated version for some additional fixes and stuff. But, it's slowing the process too much. Ex: A combination of total 32 images of a same combination are merged for 3:23 min., and the same one with the new version takes 5:02 min.
Can you tell me, what is the big difference between these versions, given that the documentation and release notes doesn't provide much. Any assistance would be appreciated. Please let me know if you need any more details.
Thank in advance,
Alex
The biggest difference was that you needed to install the C++ redistributable for the first version. With the latest version you no longer need this. But to make this possible I had to drop support for OpenMP. OpenMP is used to run an operation multithreaded. You could compare it with a Parallel.For. That would improve the performance of a single operation. But without OpenMP there is a performance benefit when you create threads yourself. I wonder what happens when you first combine only two images in the sequence multithreaded. For example combining 16 images like this = 16 * 2 => 8 * 4 => 4 * 8 => 2 * 16
Do you think that it's because of the support for the openMP it doesn't utilize the full processor power available and therefore I get this lag of 3 seconds upon each combination of images ?
That's what I am suspecting but I have no proof for this. Have you tried to combine the images in a parallel loop to test if that improves your performance?
Still haven't tried that one, it will take a bit more modifications to the code, therefore I am trying to find where the lag is taking place, but we'll probably go with that one, if nothing else remains. I'll let you know on the details, if we have improvement that is. Thanks
I just published a new release of Magick.NET that has OpenMP support. This is only for the x64 versions of Magick.NET (Q8/Q16/Q16-HDRI). Not sure if if will increase the performance of your application but it might be worth to give it another try. That package will require you to install the C++ redistributable on the machine that is running your application. You can find the packages here:
https://www.nuget.org/packages/Magick.NET-Q8-x64-OpenMP/
https://www.nuget.org/packages/Magick.NET-Q16-x64-OpenMP/
https://www.nuget.org/packages/Magick.NET-Q16-HDRI-x64-OpenMP/
Would love to hear your benchmark results @aleks989.
Not the original poster, but the Q8-x64-OpenMP package is making a huge difference for me. Thank you for releasing it!
It seemed like no matter what I did, ConnectedComponents and Blur were blocking even when parallelized and it was driving me mad. This either fixes those issues or masks them in such a way where CPU utilization is back up to 100%.