[cairo] Cairo 1.3 performance loss

Behdad Esfahbod behdad at behdad.org
Fri Feb 2 21:53:50 PST 2007

On Thu, 2007-02-01 at 10:51 +0200, Jorn Baayen wrote:
> Yeap. One idea would be to add a mode that times X iterations instead
> of single ones, pretty much like my little tool above does.

Basically what we want to make sure of is that the value we measure is
of a few orders of magnitude more precision of that of the timer we use.
That is, assuming something on the order of milliseconds, we want to
measure values not smaller than a second.  One way to do this is to time
a constant number of iterations that is large enough to guarantee that
it takes more than a second for a test.

On the other hand, we don't want to spend too much time on a test.  So
for slower tests, we don't really want to run them as many times as the
faster ones.

And we don't want to run the tests too few times.

These directly lead to a simple algorithm: while total time spent < X
seconds or total number of runs < Y runs, do repeat the test.

X and Y are configurable.  1 second and 10 runs are some arbitrarily
sensible values.

Last but not least, we are not only interested in the mean time, but
also in how stable it is.  That is, the standard deviation (for lack of
a better measure).  And unfortunately, if the test runs too fast, in the
order of the precision of the timer, there's just no way to measure the
standard deviation.  Measuring the running time of multiple test runs
seriously degrades the precision of the standard deviation we can
compute, but I'm not sure there's much we can do about it.

My 0.02 CADs

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759

More information about the cairo mailing list