[rrd-developers] pango / fontconfig / cairo performance with rrdtool

Tobias Oetiker tobi at oetiker.ch
Sun Aug 31 12:36:02 CEST 2008


Wizards,

A few months back I ported rrdtool (www.rrdtool.org) over from
libart/freetype to cairo/pango. It all went quite well and the
resulting graphs look cool. But when it comes to performance things
look realy bad.

Creating a little test graph with rrdtool 1.2 (libart/freetype)
takes about 0.01s while the same graph with (cairo/pango) takes
0.2s in other words, I am seeing a 20 times slow down. Creating
several graphs in the same session does not change things much.

I have sat down with callgrind to analyze and found that 80% of the
time is spend in the

  pango_font_map_load_fontset

function. I bet I am doing something terribly wrong here, since I
use the same font in only 2 sizes all over the graph.

I have based my code on the example in the documentation
http://developer.gimp.org/api/2.0/pango/pango-Cairo-Rendering.html#rotated-example
but maybe this is not optimal. I tried to add some caching but it
did not help much.

I have put a few details up on

  http://tobi.oetiker.ch/rrd_pango/

any ideas ?

cheers
tobi


-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900



More information about the rrd-developers mailing list