summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-02-11 19:25:57 -0500
committerMatthias Clasen <mclasen@redhat.com>2020-05-17 22:29:30 -0400
commit1401a69faf0a70efab61dc5b5064fc5d9fd778bf (patch)
tree5293cdb42c68a49a1fdacaa0429302b0987f5c2d
parentf958a6ecf75ab50dcd7b8729e4fbf2b9e65ac65d (diff)
downloadgtk+-1401a69faf0a70efab61dc5b5064fc5d9fd778bf.tar.gz
perf test: Discard invalid runs
It turns out that we occasionally get a 0, which we should just ignore to avoid skewing the numbers. Also add a --verbose option which dumps all values and makes debugging this sort of issue easier.
-rw-r--r--testsuite/performance/test-performance.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/testsuite/performance/test-performance.c b/testsuite/performance/test-performance.c
index 506763a751..1733b614ca 100644
--- a/testsuite/performance/test-performance.c
+++ b/testsuite/performance/test-performance.c
@@ -46,6 +46,7 @@ static char *opt_detail;
static char *opt_name;
static char *opt_output;
static gboolean opt_start_time;
+static gboolean opt_verbose;
static GOptionEntry options[] = {
{ "mark", 0, G_OPTION_FLAG_NONE, G_OPTION_ARG_STRING, &opt_mark, "Name of the mark", "NAME" },
@@ -54,6 +55,7 @@ static GOptionEntry options[] = {
{ "runs", '0', G_OPTION_FLAG_NONE, G_OPTION_ARG_INT, &opt_rep, "Number of runs", "COUNT" },
{ "name", '0', G_OPTION_FLAG_NONE, G_OPTION_ARG_STRING, &opt_name, "Name of this test", "NAME" },
{ "output", '0', G_OPTION_FLAG_NONE, G_OPTION_ARG_STRING, &opt_output, "Directory to save syscap files", "DIRECTORY" },
+ { "verbose", '0', G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, &opt_verbose, "Verbose output", NULL },
{ NULL, }
};
@@ -204,6 +206,9 @@ main (int argc, char *argv[])
/* Ignore the first run, to avoid cache effects */
for (i = 1; i < opt_rep; i++)
{
+ if (values[i] == 0)
+ continue;
+
if (min > values[i])
min = values[i];
if (max < values[i])
@@ -212,7 +217,14 @@ main (int argc, char *argv[])
total += values[i];
}
- g_print ("%d runs, min %g, max %g, avg %g\n",
+ if (opt_verbose)
+ {
+ for (i = 1; i < opt_rep; i++)
+ g_print ("%g ", MILLISECONDS (values[i]));
+ g_print ("\n");
+ }
+
+ g_print ("%d runs counted, min %g, max %g, avg %g\n",
count,
MILLISECONDS (min),
MILLISECONDS (max),