[babl] babl: add a test iteration multiplier
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] babl: add a test iteration multiplier
- Date: Wed, 17 Jan 2018 03:00:15 +0000 (UTC)
commit 636ac86e9f5fd9dbc5d062d5394bd32eb2196e72
Author: Øyvind Kolås <pippin gimp org>
Date: Wed Jan 17 03:57:23 2018 +0100
babl: add a test iteration multiplier
On my system many of the conversions got measured to costs of 3 4 and 5, these
makes a big room for measurement errors, to increase reliability the tests are
now run 4 times - making it a ranking of contenders with fewer collisions.
This will slightly increase incurred delayed on search for conversions.
babl/babl-fish-path.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c
index eb10fe9..d387fa8 100644
--- a/babl/babl-fish-path.c
+++ b/babl/babl-fish-path.c
@@ -26,6 +26,8 @@
#define BABL_HARD_MAX_PATH_LENGTH 8
#define BABL_MAX_NAME_LEN 1024
+#define BABL_TEST_ITER 4
+
#ifndef MIN
#define MIN(a, b) (((a) > (b)) ? (b) : (a))
#endif
@@ -926,7 +928,7 @@ init_path_instrumentation (FishPathInstrumentation *fpi,
fpi->source, fpi->ref_destination,
fpi->num_test_pixels);
ticks_end = babl_ticks ();
- fpi->reference_cost = ticks_end - ticks_start;
+ fpi->reference_cost = (ticks_end - ticks_start) * BABL_TEST_ITER;
/* transform the reference destination buffer to RGBA */
_babl_process (fpi->fish_destination_to_rgba,
@@ -1002,6 +1004,7 @@ get_path_instrumentation (FishPathInstrumentation *fpi,
/* calculate this path's view of what the result should be */
ticks_start = babl_ticks ();
+ for (int i = 0; i < BABL_TEST_ITER; i ++)
process_conversion_path (path, fpi->source, source_bpp, fpi->destination,
dest_bpp, fpi->num_test_pixels);
ticks_end = babl_ticks ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]