freetype-devel
[Top][All Lists]
Advanced

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

CFF loading overhead in tracing


From: Behdad Esfahbod
Subject: CFF loading overhead in tracing
Date: Sun, 30 Jul 2023 12:41:14 -0600

Hi,

In benchmarking FreeType face loading, I noticed that the following two loops take considerable time when loading CFF1 face:


--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -695,8 +695,8 @@
 
 
           FT_TRACE4(( "  %5d ", idx + 390 ));
-          for ( l = 0; l < s1len; l++ )
-            FT_TRACE4(( "%c", s1[l] ));
+          //for ( l = 0; l < s1len; l++ )
+            //FT_TRACE4(( "%c", s1[l] ));
           FT_TRACE4(( "\n" ));
         }
 
@@ -710,8 +710,8 @@
 
 
           FT_TRACE4(( "  %5d ", cff->num_strings + 390 ));
-          for ( l = 0; l < s1len; l++ )
-            FT_TRACE4(( "%c", s1[l] ));
+          //for ( l = 0; l < s1len; l++ )
+            //FT_TRACE4(( "%c", s1[l] ));
           FT_TRACE4(( "\n" ));
         }
       }


I don't have tracing enabled, but the compiler doesn't seem to have wiped away the loop. I'm not sure why. At any rate, I wonder if these can be guarded by FT_DEBUG_TRACE or some other way to remove the overhead?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]