freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Benchmarking FreeType


From: Vincent Caron
Subject: [Devel] Benchmarking FreeType
Date: 07 Jun 2002 02:57:45 +0200

Hello,

  besides the fttimer test whose purpose is to bench the scanline
renderer, I wanted to know the big figures about some common FreeType
calls and what the different caches were worth for. I'm using FreeType
for OpenGL rendering purposes, and I'm having a bunch of glyphs to
display at _every_ frame. Of course, I'm extensively relying on texture
cache, but this is sometimes a sparse space : create a double-buffered,
zbuffered and stenciled 1280x1024 context on a 8MB video card, and
wonder where your texture memory is gone :).

I wrote a little program which benchmarks the kind of calls you heavily
rely on. It also let you test memory pressure and see how much cache
miss hurts. It also shows why you _must_ use FreeType caches (I've seen
many libs on the net zapping that part). I'm not sure if it is of
general interest, but it helps me to separate issues from FT and my code
for now...

BTW, it's there : http://zerodeux.net/ft/


All bench run on a Linux 2.4 box with a P3-800. Read 'us/op' as
microsecond per operation. Cache memory is 1MB, so there's actually no
memory outage. On a bitmap font (helvetica 14px, PCF, from XFree86) :

Load                           :   1.6 us/op
Load + Get_Glyph               :   2.6 us/op
Load + Get_Glyph + Get_CBox    :   2.7 us/op
Get_Char_Index                 :   0.3 us/op
CMap cache (1st run)           :   0.8 us/op
CMap cache                     :   0.4 us/op
Outline cache (1st run)        :   4.8 us/op
Outline cache                  :   0.5 us/op
Bitmap cache (1st run)         :   4.0 us/op
Bitmap cache                   :   0.5 us/op
SBit cache (1st run)           :   2.6 us/op
SBit cache                     :   0.5 us/op

And with the classical MS Arial.ttf :

Load                           :  72.1 us/op
Load + Get_Glyph               :  78.7 us/op
Load + Get_Glyph + Get_CBox    :  78.9 us/op
Get_Char_Index                 :   0.2 us/op
CMap cache (1st run)           :   0.8 us/op
CMap cache                     :   0.4 us/op
Outline cache (1st run)        :  82.2 us/op
Outline cache                  :   0.6 us/op
Bitmap cache (1st run)         : 105.4 us/op
Bitmap cache                   :   0.5 us/op
SBit cache (1st run)           : 104.9 us/op
SBit cache                     :   0.5 us/op

Comments :

- on the whole, FT is blazing fast. All loading is done with the default
FT stream (stdio). Linux cache sure helps a lot.

- a SBit cache is a 5x gain on a bitmap font, and is of course
invaluable on a scalable font. And metrics are ready for immediate use.

- a CMapCache_Lookup() is actually slower than a Get_Char_Index(), I'm
wondering if something is wrong in my code.





reply via email to

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