Re: command.c: gm benchmark iterations and duration

Bob Friesenhahn <[email protected]> Thu, 28 Aug 2008 10:57:36 -0500 (CDT)
Newsgroups gmane.comp.video.graphicsmagick.core
Message-ID <[email protected]>
On Thu, 28 Aug 2008, Nguyen Vu Hung wrote:

> Hi,

Please use plain ASCII email when posting to the list!

> gm benchmark has 2 options, but we can use only one of them.
> I think we should state this in "gm benchmark -help":

I was going to implement this but then I noticed that the help message 
already makes this clear:

% gm benchmark -help
GraphicsMagick 1.3 unreleased Q16 http://www.GraphicsMagick.org/
Copyright (C) 2002-2008 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.

Usage: utilities/gm benchmark options command ...
Where options include one of:
   -duration duration  duration to run the benchmark (in seconds)
   -iterations loops   number of iterations to execute
Followed by some other GraphicsMagick command
utilities/gm benchmark: Improper arguments supplied, please see 
manual.

Note the line "Where options include one of".

> but I think sometimes average time is not enough, we need to know 
> deviation of times to see how balance the elapsed time is.

The problem with doing this is that the overhead of checking the timer 
will alter the results, but more significantly, that the portable 
timer resolution is often not very good.  For example, Windows only 
offers 20ms granularity.  Many Unix systems offer 10ms, but some could 
be as terrible as 100ms since the traditional Unix clock tick is 
100Hz.  The "user time" measurement is often based on if the process 
used CPU in one of those 100Hz scheduling intervals.  The possibility 
of poor timer resolution is a reason for running the benchmark for 
tens of seconds rather than a few iterations or just a second.

When testing on powerful systems with medium sized (e.g. 1024x256) 
images I am already seeing iteration rates close to 12K/second.  At 
these rates we will be measuring the deviation of the time measurement 
rather than the individual image processing times.  We will also be 
seeing the impact of the system process scheduler, which may execute 
some other process in the mean-time.

Bob

======================================
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/