CFF loading overhead in tracing

Behdad Esfahbod <[email protected]>
Newsgroups gmane.comp.fonts.freetype.devel
Message-ID <CAF63+7UTAJsMWsH-zi6BVtO6LEKL5QCVpyUPfYz7Rp1_KkHpPg@mail.gmail.com>
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?


behdad
http://behdad.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.