Re: CFF loading overhead in tracing

Behdad Esfahbod <[email protected]>
Newsgroups gmane.comp.fonts.freetype.devel
Message-ID <CAF63+7VzUrLAdaMWA_ZxUnm79y5W0Hu2+7+c_xaT5E3kDjdyAA@mail.gmail.com>
Humm. I cannot reproduce this anymore. Will report if that changes.

behdad
http://behdad.org/


On Sun, Jul 30, 2023 at 12:41 PM Behdad Esfahbod <[email protected]> wrote:

> 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.