From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a0ff1df3c152ae8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-15 06:25:35 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.algonet.se!algonet!news000.worldonline.se!news-stob.telia.net!news-sto.telia.net!194.22.194.4.MISMATCH!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail Message-ID: <3BF3DBE9.732D097F@ida.his.se> From: a98mican@ida.his.se X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.8-26mdk i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: GNAT and profiling! References: <3BF22DF1.B59AC367@ida.his.se> <3BF27DE6.C6620CE7@Raytheon.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 15 Nov 2001 14:08:15 GMT NNTP-Posting-Host: 213.64.3.210 X-Complaints-To: abuse@telia.com X-Trace: newsb.telia.net 1005833295 213.64.3.210 (Thu, 15 Nov 2001 15:08:15 CET) NNTP-Posting-Date: Thu, 15 Nov 2001 15:08:15 CET Organization: Telia Internet Xref: archiver1.google.com comp.lang.ada:16566 Date: 2001-11-15T14:08:15+00:00 List-Id: Mark Johnson wrote: > Michael Andersson wrote: > > > Hi! > > I want to use gcov to profile my code. The problem is that I want to > > compare one version of a program with a new version of the program to > > see weather or not I gained some performace. But from what I can se gcov > > counts how many times each line of code was executed. This would mean > > that each version would have to be executed an equal amount of time. I > > could use a counter for each function an print the contents of the > > counter each frame and then compare it the output from the other version > > of the program. This could become quite an effort since there are a lot > > of functions to compare. > > > > Could I in some way use gcov to do this? > > I am not sure why you would want to do that. Can you describe what problem > you are trying to solve? > > For example, if you want to reduce run time or CPU time for the "same" > amount of work, why not measure that? You can give each version the same > amount of work and check it externally. That would be the measure of > improvement. Then you use gcov to figure out the hot spots in your code - > fix them, and rerun the measurements. > > Another note on gcov and similar coverage tools - turn off code inlining > until the very end of your analysis. We had an application that used a > linear search through an unordered list to look up tokens. OK for small jobs > - very inefficient on anything sizable. The original author had inlined the > look up function, so there were hot spots all over the application. It > wasn't until we got rid of that inlining to find our real problem - fix the > algorithm, and then the application ran MUCH faster. > --Mark Hi! What I want to do is to compare two different versions of my Ada terrain engine. This is because the new version of the engine ran slower the the old one which it shouldn't. If I could compare how many times each function were called in each version it would be easier to find out were the problem is located. Thanks in advance! /Michael Andersson