After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 106892 - pango_x_render performance
pango_x_render performance
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Pango X11 Mainter alias
Pango X11 Mainter alias
Depends on:
Blocks:
 
 
Reported: 2003-02-23 23:12 UTC by Morten Welinder
Modified: 2007-06-20 18:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Draw multiple characters at a time. (2.53 KB, patch)
2003-02-23 23:12 UTC, Morten Welinder
none Details | Review
Revised patch (2.71 KB, patch)
2003-02-24 14:43 UTC, Morten Welinder
none Details | Review
Rerevised patch (4.44 KB, patch)
2003-02-28 22:17 UTC, Morten Welinder
none Details | Review
Patch as applied (3.62 KB, patch)
2003-05-27 20:16 UTC, Owen Taylor
none Details | Review

Description Morten Welinder 2003-02-23 23:12:12 UTC
pango_x_render draws by calling the X layer one character at a time.
That hurts a bit, probably especially for remote connections.

Patch coming up.
Comment 1 Morten Welinder 2003-02-23 23:12:54 UTC
Created attachment 14562 [details] [review]
Draw multiple characters at a time.
Comment 2 Owen Taylor 2003-02-23 23:41:35 UTC
Maybe I'm missing something here, but where does the patch
handle the case where the character's aren't positioned
as XDrawString16() would position them?
Comment 3 Morten Welinder 2003-02-23 23:47:30 UTC
Fails miserably?

Does that happen?  If so, can it easily be checked for?
Comment 4 Owen Taylor 2003-02-23 23:57:53 UTC
Depends on the module, but most of them (including the "basic"
shaper) will position characters such as accents at position
other than the "natural" one at least sometimes.

The character-by-character positioning did have a point
other than just slowing rendering down :-)

It shouldn't be hard to use XTextWidth() to coellesce
runs of characters positioned naturally.

Since I consider the X font backend more or less dead at
this point, I've never bothered to go back and try and to
improve things. (it didn't seem to be a huge bottleneck
when I did care about that backend.)
Comment 5 Morten Welinder 2003-02-24 14:43:28 UTC
Created attachment 14578 [details] [review]
Revised patch
Comment 6 Morten Welinder 2003-02-24 14:46:01 UTC
Ok, how about that one?

Re pangox: I don't think you can expect it to go away for a few more
years.  The xft backend is insanely slow (10 times worse than pangox)
without XRENDER on the display.  (I have no idea how it fares with
XRENDER.)

If my googling is right, Sun only added XRENDER in December 2002.  It'll
be years before it hits production machines.
Comment 7 Morten Welinder 2003-02-28 22:17:26 UTC
Created attachment 14701 [details] [review]
Rerevised patch
Comment 8 Morten Welinder 2003-02-28 22:19:13 UTC
This patch saves a few percent in cpu and probably a whole lot more
in X traffic.  I don't believe there is anything controversial here.
Comment 9 Owen Taylor 2003-05-27 20:16:31 UTC
Created attachment 16883 [details] [review]
Patch as applied
Comment 10 Owen Taylor 2003-05-27 20:20:06 UTC
I applied a slightly-toned down version that always calls
XTextWidth16 instead of trying to optimize that out ...
less code to worry about bugs in, and XTextWidth16()
isn't slow.

Tue May 27 16:06:34 2003  Owen Taylor  <otaylor@redhat.com>
 
        * pango/pangox.c (pango_x_render): Patch from Morten
        Welinder to collect characters into runs of the
        same font with natural offsets before drawing them.
        (#106892, Morten Welinder)