[comp.windows.x] Complex measurement with xbench program.

adamsc@shark.WV.TEK.COM (Chuck Adams) (09/11/89)

I have been having so much fun with performance analysis I thought
I would try xbench on a memory limited, no virtual memory machine,
e.g.  a X terminal.  Oops, I found another problem with the code.

It seems the complex test (file complex1.c) creates a GC for
each window it opens.  It does not free that memory.  Thus as
one would expect eventually the program will run out of memory.
Thus to be fair to our new line of terminals and others who
may be in similar situations, I suggest the following modification
to complex1.c:

-------------------------- patch ----------------------------------------------

*** /tmp/,RCSt1025626	Mon Sep 11 09:35:33 1989
--- /tmp/,RCSt2025626	Mon Sep 11 09:35:34 1989
***************
*** 71,76
  	    XCopyArea(dpy, subwin, subwin, subGC, 0, 10, 400, 190, 0, 0);
  	    XSync(dpy, 0);
  	    XDestroyWindow(dpy, subwin);
  	    ncomplex++;
  	}
  	return ncomplex;

--- 71,77 -----
  	    XCopyArea(dpy, subwin, subwin, subGC, 0, 10, 400, 190, 0, 0);
  	    XSync(dpy, 0);
  	    XDestroyWindow(dpy, subwin);
+ 	    XFreeGC(dpy, subGC);
  	    ncomplex++;
  	}
  	return ncomplex;

-------------------------------------------------------------------------------

---- chuck adams
adamsc@orca.wv.tek.com
{decvax ucbvax hplabs}!tektronix!orca!adamsc
Interactive Technologies Division/Visual Systems Group
Tektronix, Inc.
P.O. Box 1000, M/S 61-049
Wilsonville, OR 97070
(503) 685-2589