[comp.soft-sys.andrew] speed of drawing text under OW 2.0

janssen@parc.xerox.com (Bill Janssen) (09/06/90)

We've noticed that Andrew typescript (and ez, etc.) scrolls much more
slowly under OpenWindows 2.0 than does X11R4 xterm (perhaps 6-8 times
more slowly), on a Sun (SunOS 4.0.3) SparcStation-1 with a GX board. 
This seems to be because Andrew uses "PolyText8" X protocol requests to
draw strings, and xterm uses "ImageText8" to draw strings.  "PolyText8"
is a much more general request than "ImageText8", and apparently
underoptimized in the OW server.  As far as I can see in traces of the
typescript tool, Andrew doesn't use the more general facilities of the
"PolyText8" request, and could use the simpler and
more-likely-to-be-optimized "ImageText8" request instead.  That is,
Andrew seems only to draw one TEXTITEM at a time, they always seem to be
strings (never offsets or fonts), and they always seem to use the same
font.

It would seem possible to change the call to XDrawString in
atk/basics/x/xgraphic.c to a call to XDrawImageString, without
disturbing anything.  We'd still revert to XDrawText (and thus
PolyText8), when drawing complicated fonts, but would win on drawing
simple fixed-width fonts.

Any quarrels with this analysis?

Bill

wdc@ATHENA.MIT.EDU (Bill Cattey) (09/06/90)

I fixed a bug in the APA16 X server some time ago when it would not
properly handle more than one TEXTITEM in the PolyText8 calls that
Andrew was making.

So for the moment, I will disagree with the findings of your tracings.

It may be that a patch came along that cut the items to the degenerate
case.  Who was last inside drawtextv?

-wdc

ajp+@ANDREW.CMU.EDU (Andrew Palay) (09/07/90)

The problem with using DrawImageText is that it draws both the
foreground and the background.  This works well when using a font where
the width of each character in the font encompasses all the bits of the
font (thus there is no overlapping of character bounding boxes).  This
is not the case for most of the fonts that we use and thus DrawImageText
would often eliminate portions of other characters.  One could say that
this isn't the case for typescript where you are using a fixed width
font, but some people don't use a fixed width font in typescript and to
special case drawing of text in this way will probably be difficult.

Andy