freetype-devel
[Top][All Lists]
Advanced

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

Re: Logging Library-GSOC


From: Werner LEMBERG
Subject: Re: Logging Library-GSOC
Date: Sat, 18 Jul 2020 12:03:39 +0200 (CEST)

> I have tried the query performance counter/frequency method for
> example program:
> (https://www.freetype.org/freetype2/docs/tutorial/example1.c) on
> Windows with arial.ttf and FT2_DEBUG=any:7 on
> string:"qwertyuiopasdfghjklzxcvbnm" which produced 24260 logs.
>
> I have executed the test program multiple times and below are the
> average time for each case in seconds:
>
> FT_LOGGING:8 sec ( writes logs to file freetype.log)
> FT_DEBUG_LEVEL_TRACE: 40 sec (writes logs to stderr)
> NO_DEBUGGING:7  sec

This looks very unrealistic.  Do you redirect data sent to stderr to
an output file?

Otherwise I guess the big difference between `FT_LOGGING` and
`FT_DEBUG_LEVEL_TRACE` is due to file buffering.  In other words, data
sent to `stderr` gets output line by line to the screen, which is
slow, while data sent to the log file gets buffered completely, and it
is written to the disk in asynchronously to avoid write delays.

Maybe it makes sense to use C function `setvbuf` to exactly control
the buffering mode of the output file descriptor.

> I have also prepared a test program for this @ here
> <https://github.com/Priyeshkkumar/FreeTypeExamples/tree/master/Windows/main>
> , so that if anyone wants to test they can also try and test the
> results...

Could you test your program under a Unix-like OS (i.e., GNU/Linux,
MacOS, other BSD variants), too?


    Werner



reply via email to

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