-monitor option prints status too often and slowdown the process

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
vmr
Posts: 7
Joined: 2015-04-06T04:07:42-07:00
Authentication code: 6789

-monitor option prints status too often and slowdown the process

Post by vmr » 2015-09-02T02:12:12-07:00

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

User avatar
magick
Site Admin
Posts: 11077
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick » 2015-09-02T05:34:54-07:00

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.

vmr
Posts: 7
Joined: 2015-04-06T04:07:42-07:00
Authentication code: 6789

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

Post by vmr » 2015-09-02T05:54:30-07:00

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

User avatar
magick
Site Admin
Posts: 11077
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick » 2015-09-02T06:52:16-07:00

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.

Post Reply