[rrd-developers] [rrd] Re: pango / fontconfig / cairo performance with rrdtool
Behdad Esfahbod
behdad at behdad.org
Mon Sep 1 01:17:56 CEST 2008
Tobias Oetiker wrote:
> Behdad,
>
>> Hi Tobias,
>>
>> The part creating the layout looks good. Any *interesting* thing will be
>> hidden in other parts of the code, namely the code calling this function. In
>> general I'm quite surprised that you are hitting the load_fontset() path all
>> the time as the fontsets should be cached and simply reused. One way to debug
>> it is to run with FC_DEBUG=1 and look for all different Sort Patterns passed
>> to fontconfig and see how they differ (I'm guessing minor difference in the size).
>
> I just finished modifying the code, so that I am keeping multiple
> sets of PangoFontDescriptions for each combination of font and
> size. I then pass the FontDescription into the text function. This
> magically resolved the problem ... now the load_fontset gets only
> called 3 times or so ...
>
> Does this match expectations ?
Not really. As I said, most probably you have been creating
slightly-different font descriptions. You can run the old code and print out
the font descriptions to see what has been causing it. In general you should
not need to cache much to make Pango behave. Just use the default font map
(which you are) and it should work reasonably.
behdad
> cheers
> tobi
>
>
>
More information about the rrd-developers
mailing list