On 12/1/06, <b class="gmail_sendername">Behdad Esfahbod</b> <<a href="mailto:behdad@behdad.org">behdad@behdad.org</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Wed, 2006-11-29 at 09:24 -0500, Xan Lopez wrote on cairo list:<br>><br>> Anyway, thanks to the nice guys from opened-hand I received the patch<br>> that fixes the symbol resolving brokeness of my oprofiler, so I can
<br>> now provide sane profiles. I'm attaching profiles for cairo, pango and<br>> pangocairo from a timetext run.<br><br>Can you attach a merged profile too (one for all libraries, oprofile<br>does that I believe)? With separate profiles, it's not as easy to see
<br>what's going on, without guessing and all...</blockquote><div><br>Sure, I tried once but it was too big for the list. I've got my fd.o webspace already, I'll put the whole set of profiles there tonight, hopefully.<br>
</div><br>(...)<br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">and now there's only 1 get_glyph_extents() calls per glyph per expose.
<br>That one is a bit harder to fix, unless one caches per-line or per-item<br>extents. There's actually a patch for this already:<br><br> <a href="http://bugzilla.gnome.org/show_bug.cgi?id=135683">http://bugzilla.gnome.org/show_bug.cgi?id=135683
</a><br><br>The problem is, PangoLayout has API that gives away pointer to internal<br>structures, such that you can modify the glyph widths, and that is<br>legitimate use. For example Firefox+Pango uses that to justify lines.
<br>So I was under the impression that we cannot meaningfully cache much,<br>until I figured, well: we can cache, until the user asks for that evil<br>pointer! So, unless we have handed out a pointer to internal stuff, we
<br>can cache. And even when we have given the pointer away, we can cache<br>as part of a single pango operation. So, I'm going to look more into<br>this, and come up with a sensible scheme that doesn't introduce<br>regressions. With that in place, it may make sense to revert some of my
<br>pango_glyph_string_get_width() uses above and use the cached values;<br>maybe not. Donno.</blockquote><div><br>Looking forward to it, with your patches you dropped glyph extents calculation from the first place,<br>but it's still quite high in the profile :)
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Anyway, that's all for now. Some numbers:<br><br>For timetext.c [2]:<br><br>Before:
<br>Drawn label 112412 times. Average time spent drawing (in seconds): 0.000105<br><br>After:<br>Drawn label 123871 times. Average time spent drawing (in seconds): 0.000063<br><br>So, in this case, the expose time was improved 40%, and overall
<br>performance was improved 10%. I expect (much) higher numbers for the<br>latter on tiny gadgets, but can't tell unless I'm offered one ;-).</blockquote><div><br>Well, I'm not getting numbers *that* impressive here, don't exactly know why. Might just be that our environments are quite
<br>different beasts, might be that I'm doing something wrong. Anyway, the results are quite impressive:<br><br>Before: Drawn label 2811 times. Average time spent drawing (in seconds): 0.001882<br><br>After: Drawn label 2903 times. Average time spent drawing (in seconds):
0.001702<br><br>And if you want a tiny gadget just forward me a postal address to ship it ;)<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Offtopic:<br><br>I use a small toy of mine to write /probes/ that can do cool things<br>about what library calls are being made without having to<br>compile/install pango all the time. It's a tiny script called bprobe,<br>
available from GNOME CVS. For example, this is the probe I used to<br>figure out what's going on:<br><br><a href="http://cvs.gnome.org/viewcvs/*checkout*/bprobe/probes/pango-glyph_extents.probe?rev=HEAD">http://cvs.gnome.org/viewcvs/*checkout*/bprobe/probes/pango-glyph_extents.probe?rev=HEAD
</a><br><br>However, this only works because Pango doesn't have the machinery to<br>avoid PLT usage for local symbols. That's another thing to look into,<br>may have measurable performance (and size) improvements on smaller
<br>devices.</blockquote><div><br>Looks pretty cool, I'll certainly give it a try.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> [1]http://lists.freedesktop.org/archives/cairo/2006-November/008628.html<br>> [2]http://folks.o-<a href="http://hand.com/jorn/pango-benchmarks/timetext.c">hand.com/jorn/pango-benchmarks/timetext.c</a><br><br><br>Cheers,
<br>--<br>behdad<br><a href="http://behdad.org/">http://behdad.org/</a><br><br>"Those who would give up Essential Liberty to purchase a little<br> Temporary Safety, deserve neither Liberty nor Safety."<br> -- Benjamin Franklin, 1759
<br><br><br><br></blockquote></div><br>