Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!snorkelwacker!bloom-beacon!EXPO.LCS.MIT.EDU!rws From: rws@EXPO.LCS.MIT.EDU (Bob Scheifler) Newsgroups: comp.windows.x Subject: Re: How can I evaluate the performance/efficiency of my X program? Message-ID: <9002021428.AA09154@expire.lcs.mit.edu> Date: 2 Feb 90 14:28:15 GMT References: <1377@cacilj.UUCP> Sender: root@athena.mit.edu (Wizard A. Root) Organization: The Internet Lines: 31 The programs linked with this library run slower than the equivalent program run on SunView. You haven't said anything about the server you're using, so it's rather difficult to guess at where performance problems might be. My profiled output at least tells me how many calls I am making. Is there some way to figure out how much time each Xlib call is really taking? Assuming your system supports it, compile and link everything -pg, and use gprof. Unfortunately, most of the real work is being done by the server, as evidenced by the cpu time (around 5% utilized!). (5% is large?) If you really want to understand performance, it will pay to build a profiled version of the server as well. Is the high activity in _XGenerateGCList and _XFlushGCCache indicate that I am not using GCs effectively? Not necessarily, but it depends in part on the server implementation. On some servers, switching among a few GCs, changing one or two attributes at each switch, will be more effective than using a large number of GCs with static contents. For most servers in the MIT distribution, however, using GCs with static contents will probably tend to be faster. But, it will be hard to determine real costs without profiling both the client and the server.