summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2010-01-02 17:36:17 -0500
committerAdam Jackson <ajax@redhat.com>2010-01-02 17:36:17 -0500
commit374bee27ef4d45044f7562ffed162a5b6f095e40 (patch)
treed4f0560614ca4835f2be86742218ee2eb403003c
parentaf29c01b5d41f08053263dfe251d0a2a26c7eb1f (diff)
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 <ajax@redhat.com>
-rw-r--r--x11perf.c9
1 files 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)