[comp.windows.x.motif] Re Motif Text Widget Performance Problems

thp@westhawk.UUCP ("Timothy H Panton.") (10/12/90)

David Robbins <dcr0@bunny.gte.com> writes: 
> With 50-100 text widgets on a form, the
> thing takes much too long to put the form up on the screen

First a disclaimer, I know nothing about the Motif Textwidget, when
I encountered a similar set of problems we were using the HP widgets.
But it sounds as if the problems are related.

> Every text widget uses the same pixmap for a cursor. 
Not exactly, the colours can be different. I seem to recall that we
ended up caching this pixmap where possible. (Fonts too ? I don't recall.)
The Hp widgets never free'ed the pixmaps either, causing server growth.

The basic problem as we saw it was that the Textedit widget is overspecified
as a form entry component. A single line, 'fixed' length, single Source widget 
with many fewer translations would be nice. 
We ended up pruning Textedit 'till we came close to this, but more radical cuts 
might have been better. 
The (lowers voice) OpenLook spec has a field editor of just this kind, but AT+T's
Xt+ implements it a full texedit widget in a manager, sigh.

> create a set of text widgets ...
> reuse them each time a form is displayed.
Yeah, we did that, works well unless you get involved in geometry management.
So we created one of each type of form (well nearly) at startup and then use them
as required.

> proceeds to send out a pile of X server requests!
Well, we found that a faster server helped a great deal (R4 vs R3 say)

Also don't forget the two essential widget speed hacks, 
	a) get a good malloc()
	b) use XtManageChildren() rather than several calls to XtManageChild().

Hope that helped.
Tim.
+----------------------------------------------------------------------------+
|Tim Panton, Westhawk Ltd.    "... avoiding vain and profane babblings."     |
|Phone: +44 928722574                              -1 Timothy 6:20.          |
|uucp : ..!mcvax!ukc!westhawk!thp                                            |
|Paper: Westhawk Ltd. 26 Rydal Grove, Helsby, Cheshire, WA6 OET. UK.         |
+----------------------------------------------------------------------------+

dcr0@GTE.COM (10/12/90)

Thanks for your advice.  It is helpful.

1) The fact that shared cursors are affected by different colors
   has occurred to me, and it looks like Motif didn't take that
   into account (or else I haven't spotted how they do it yet).
   But I have an idea for solving that problem.

2) The idea of creating one of each type of form hadn't occurred
   to me, but with (if I remember right) over 800 forms, I'm
   skeptical whether that will be something we could do.  Perhaps
   we could maintain a cache of forms...hmm.

3) We've demonstrated how much faster R4 is, but for the moment
   we're stuck with R3.  We do expect to field the application with
   R4.

4) We are aware of the two "essential widget speed hacks" -- we've
   already done manage-children, and will probably get around to
   malloc when it becomes a significant problem in our application
   (right now, the X server requests are the #1 problem).

Again, thanks -- you've confirmed much of my thinking, and
given me more ideas.

--- Dave