[babl] babl: look deeper, and longer for path fishes



commit a0dba440e59cb8473928f317f490fc1447e7d30d
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu Jul 12 16:47:10 2018 +0200

    babl: look deeper, and longer for path fishes
    
    We now do two iterations of +1 and +2 path lengths that take much longer than
    the configured path lengths - and now complain with a debug output listing the
    set of conversions taken to satisfy the request - giving hints on what parts
    could possibly be shortened to fewer steps.
    
    With this commit the first level of searching deeper also gets a debug message
    which would cause GIMP to print a message in some places where it earlier
    wouldnt have warned about missing fast paths.

 babl/babl-fish-path.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
---
diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c
index a22314d..30c4a68 100644
--- a/babl/babl-fish-path.c
+++ b/babl/babl-fish-path.c
@@ -568,8 +568,28 @@ babl_fish_path2 (const Babl *source,
     /* second attempt,. at path length + 1*/
     if (babl->fish_path.conversion_list->count == 0 &&
         max_path_length () + 1 <= BABL_HARD_MAX_PATH_LENGTH)
+    {
       get_conversion_path (&pc, (Babl *) source, 0, max_path_length () + 1, tolerance);
 
+      if (babl->fish_path.conversion_list->count)
+      {
+        fprintf (stderr, "babl is using a rather long chain, room exists for optimization here\n");
+        babl_list_each (babl->fish_path.conversion_list, show_item, NULL);
+      }
+    }
+
+    /* third attempt,. at path length + 2 */
+    if (babl->fish_path.conversion_list->count == 0 &&
+        max_path_length () + 2 <= BABL_HARD_MAX_PATH_LENGTH)
+    {
+      get_conversion_path (&pc, (Babl *) source, 0, max_path_length () + 2, tolerance);
+      if (babl->fish_path.conversion_list->count)
+      {
+        fprintf (stderr, "babl is using very long chain, should be optimized\n");
+        babl_list_each (babl->fish_path.conversion_list, show_item, NULL);
+      }
+    }
+
     babl_in_fish_path--;
     babl_free (pc.current_path);
   }


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