From 374bee27ef4d45044f7562ffed162a5b6f095e40 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Sat, 2 Jan 2010 17:36:17 -0500 Subject: Add -falseprecision flag for ludicrously precise stats The normal round-to-three-significant-figures behaviour, while morally correct from a benchmarking perspective, makes it impossible to measure variances between runs of less than 1%. Occasionally you really do need to measure that finely - for example, if tweaking the server's main dispatch loop. Signed-off-by: Adam Jackson --- x11perf.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/x11perf.c b/x11perf.c index 389b04b..15eb04d 100644 --- a/x11perf.c +++ b/x11perf.c @@ -40,6 +40,7 @@ SOFTWARE. /* Only for working on ``fake'' servers, for hardware that doesn't exist */ static Bool drawToFakeServer = False; +static Bool falsePrecision = False; static Pixmap tileToQuery = None; static char *displayName; int abortTest; @@ -249,9 +250,11 @@ RoundTo3Digits(double d) { /* It's kind of silly to print out things like ``193658.4/sec'' so just junk all but 3 most significant digits. */ - double exponent, sign; + if (falsePrecision) + return d; + exponent = 1.0; /* the code below won't work if d should happen to be non-positive. */ if (d < 0.0) { @@ -974,10 +977,12 @@ main(int argc, char *argv[]) foundOne = True; } else if (strcmp (argv[i], "-sync") == 0) { synchronous = True; - } else if (strcmp(argv[i], "-pack") == 0) { + } else if (strcmp (argv[i], "-pack") == 0) { xparms.pack = True; } else if (strcmp (argv[i], "-draw") == 0) { drawToFakeServer = True; + } else if (strcmp (argv[i], "-falseprecision") == 0) { + falsePrecision = True; } else if (strcmp (argv[i], "-repeat") == 0) { i++; if (argc <= i) -- cgit v1.2.3