Path: utzoo!attcan!uunet!snorkelwacker!mit-eddie!bbn.com!nic!bunny!dcr0 From: dcr0@GTE.COM (David Robbins) Newsgroups: comp.windows.x.motif Subject: Motif Text Widget Performance Problems Message-ID: <9873@bunny.GTE.COM> Date: 11 Oct 90 18:06:47 GMT Reply-To: dcr0@bunny.GTE.COM (David Robbins) Organization: GTE Laboratories, Waltham, MA Lines: 69 I have been given a small task: find a way to improve certain aspects of the Motif 1.0 text widget. I am relatively new to Motif, and may have missed some relevant discussion in this newsgroup, so bear with me. I am hopeful that some of you out there have encountered the problems I need to solve and can point to some good solutions. The application I am dealing with puts up forms on a screen for the user to fill in. These forms typically have 50-100 fields into which the user might enter data. Each of these fields is implemented as a Motif text widget. (You might question the wisdom of designing the application this way, but we're stuck with it and we have to try to make it work.) It works, in most respects. The one major problem at this point is the performance of the beast. With 50-100 text widgets on a form, the thing takes much too long to put the form up on the screen. I've spent considerable time analyzing the situation, and aside from identifying other ways to improve the performance somewhat, I am reduced to the following: The Motif text widget makes a number of X server requests that I believe to be unnecessary: 1) Every text widget uses the same pixmap for a cursor. As each text widget is realized, it mucks with that pixmap. There seems to be a lot of unnecessary work here -- if a single pixmap is to be shared (which is quite sensible), then it should be shared in such a way as to not require it to be updated in any way for every text widget that shares it. This seems easy enough to do, but why doesn't Motif do it? 2) I would like to be able to create a set of text widgets to use for fields and be able to reuse them each time a form is displayed. I would just have to update the widget's size, position, contents, and one or two other resources. BUT, when I implement it this way, it is *even slower* than when I create new widgets for each form displayed. I observe that the reason this is so is that when XtSetValues updates the text widget's resources *while the widget is unmapped* the widget proceeds to send out a pile of X server requests! I claim that this is *totally useless* since the X Toolkit explicitly provides a way for automatically and optimally getting any necessary redisplay done -- *after* all resources have been updated. This also seems easy enough to do, but why doesn't the Motif text widget take advantage of it? I can make the observation that these really do not become performance problems unless you have a large number of text widgets visible. With one or two or five text widgets, the excess cost of such things is lost in the noise. But when we do the same thing 50 or 100 times, small increases in cost are magnified. So, to make a long story short, I respectfully ask the following: A) Have any of you encountered and solved performance problems with the text widget? If so, please share what you can with me and the net. B) Am I completely off the wall in thinking that I understand the problem? C) To what extent does Motif 1.1 solve these and perhaps other performance problems, particularly for the text widget? (I do not have 1.1, nor do I expect to see it soon -- but if it answers my prayers, I may be able to acquire it.) D) Are the Motif developers aware of these problems? I'll be happy to summarize for the net any useful responses I receive by email, and of course you'll all see any responses that get posted. -- Dave Robbins GTE Laboratories Incorporated drobbins@bunny.gte.com 40 Sylvan Rd. ...!harvard!bunny!drobbins Waltham, MA 02254 CYA: I speak only for myself; GTE may disagree with what I say.