[tracker/wip/carlosg/update-perf: 3/61] utils: Improve output of tracker-benchmark




commit 7a903d24dc45e4bfc8ac731a7c58effe0d0765e8
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Aug 19 18:16:09 2022 +0200

    utils: Improve output of tracker-benchmark
    
    In order to provide a clue about the benchmark that it's currently
    busy with, do not wait for the benchmark to be complete to print its
    title.

 utils/benchmark/tracker-benchmark.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/utils/benchmark/tracker-benchmark.c b/utils/benchmark/tracker-benchmark.c
index 811c81b4b..d4471863c 100644
--- a/utils/benchmark/tracker-benchmark.c
+++ b/utils/benchmark/tracker-benchmark.c
@@ -452,6 +452,8 @@ run_benchmarks (TrackerSparqlConnection *conn)
                double elapsed = 0, min = G_MAXDOUBLE, max = -G_MAXDOUBLE, adjusted, avg;
                int elems = 0;
 
+               g_print ("%*s\t\t", max_len, benchmarks[i].desc);
+
                benchmarks[i].func (conn, benchmarks[i].data_func,
                                    &elapsed, &elems, &min, &max);
 
@@ -466,8 +468,7 @@ run_benchmarks (TrackerSparqlConnection *conn)
                }
 
                avg = elapsed / elems;
-               g_print ("%*s\t\t%.3f\t%.3f\t%.3f %s\t%.3f %s\t%3.3f %s\n",
-                        max_len, benchmarks[i].desc,
+               g_print ("%.3f\t%.3f\t%.3f %s\t%.3f %s\t%3.3f %s\n",
                         adjusted,
                         elems / elapsed,
                         transform_unit (min), unit_string (min),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]