Page 1 of 1

-monitor option prints status too often and slowdown the process

Posted: 2015-09-02T02:12:12-07:00
by vmr
Hi!
Printing status doing too often, which is slowdown the process more then ten times:
Example:
Load/Image[FX3_8950.jpg]: 6015 of 6016, 100% complete
Morphology/Image[web1280x1024\FX3_8950.jpg]: 6015 of 6016, 100% complete
Sharpen/Image[web1280x1024\FX3_8950.jpg]: 6015 of 6016, 100% completete
Resize/Image[web1280x1024\FX3_8950.jpg]: 1707 of 1708, 100% complete
Save/Image[web1280x1024\FX3_8950.jpg]: 1023 of 1024, 100% complete
It updates the status for every of 6016 scanlines, for each of 4 steps.
Generally resizing one 24MPix image takes 2 minutes (!!!) on Core i7 4700 processor

Without -monitor option it process image much faster

Re: -monitor option prints status too often and slowdown the process

Posted: 2015-09-02T05:34:54-07:00
by magick
The likely slowdown is the critical section in the threading introduced by monitoring. The critical section is called once per scanline to update the progress. Without monitoring, the threading is embarrassingly parallel and subsequently faster.

Re: -monitor option prints status too often and slowdown the process

Posted: 2015-09-02T05:54:30-07:00
by vmr
But why the critical section is called onece per scanline? Why need to update the progress such frequently?
Is it better to update progress once in half a second?

Now the -monitor option is useless.
The main purpose of this option was to show progress when processing hundreds or thouthands of files.
But its fails. It is insanity to use this option on thouthands files as processing will take a days

Re: -monitor option prints status too often and slowdown the process

Posted: 2015-09-02T06:52:16-07:00
by magick
We can throttle the progress to say every 50 scanlines, perhaps that will help, we'll get a patch into ImageMagick 6.9.2-1 Beta within a few days.