delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/23/11:48:19

Date: Thu, 23 Jan 97 17:12:07 CST
From: "Jordy Potman" <s9404198 AT student DOT utwente DOT nl>
Message-Id: <73048.s9404198@student.utwente.nl>
Reply-To: <j DOT potman AT student DOT utwente DOT nl>
To: eliz AT is DOT elta DOT co DOT il, djgpp AT delorie DOT com
Subject: Re: program with profiling info runs slower with DJGPP 2.01

From:         Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To:           j DOT potman AT student DOT utwente DOT nl
cc:           djgpp AT delorie DOT com
Subject:      Re: program with profiling info runs slower with DJGPP 2.01
In-Reply-To:  <58079 DOT s9404198 AT student DOT utwente DOT nl>
Message-ID:   <Pine DOT SUN DOT 3 DOT 91 DOT 961222172358 DOT 973D-100000 AT is>
MIME-Version: 1.0

On Sun, 22 Dec 1996, Eli Zaretskii wrote:

>On Fri, 20 Dec 1996, Jordy Potman wrote:
>
>> I've tried to reproduce the problem in a smaller program but haven't
>> succeeded yet. Small programs with only one simple function that is called
>> repeatedly (my program calls the main rendering function repeatedly)
>> don't show the problem. I think the problem is caused by repeatedly calling
>> a lot of functions (in my main rendering function there are a lot of calls
>> to other functions). This is not very easy to reproduce in a smaller
>> program.

>One situation where this might happen is if the code fits into the CPU
>cache when compiled with v2.0, but is too large under v2.01, and so cache
>thrashing happens.  I'll admit I've never seen this happen except in test
>cases specifically designed to exhibit the problem, but it might just be
>the case.

Useless profiles deleted (Jordy Potman)

>I'm a bit at a loss with these profiles.  First, the v2.01 profile seems
>to indicate *faster* runtime, not slower: the ms/call figures are smaller
>(6.17 for BitBlt in v2.01 as opposed to 9.93 in v2.0; other functions are
>also consistently faster in v2.01).  Second, you obviously run both
>versions for a *very* different elapsed times (a factor of 9 between 222ms
>for the main function in v2.01 as opposed to 2000ms in v2.0), so this is
>probably the cause of the different distribution of time in percents,
>since the timer granularity is too crude to correctly measure short runs.
>You should run your program for much longer (say, tens or hundreds of
>seconds) in order to obtain a meaningful profile.

> I can't explain why _int86 takes such a large % of time in v2.01.

>I submit that this is an artefact: the time is 0.22 seconds, which is
>1/9th of the 2.0 seconds in the v2.0 run, which was almost exactly 9 times
>longer in elapsed numbers (or do I miss something?).  So the different
>percentage is most probably due to the fact that functions which take much
>less time weren't sampled at all in the much shorter v2.01 run.

>> The
>> profile also shows that the program is a lot slower in v2.01, take a look
>> at the number of calls to UpdateWorld (the main rendering function).

>I don't see what bothers you here.  UpdateWorld is the only function
>which has almost the same time per call in both versions.  Its number of
>calls (18 in v2.01 as opposed to 151 in v2.0) is consistent with the fact
>that the total runtime of the v2.01 version was 9 times shorter than that
>of the v2.0 version.

>To sum up:

>        1) The two versions were run for a short (and unequal) time which
>might make the profile inexact.  Please run both versions for much longer
>times and post the profiles then.

>        2) If anything, the profile indicates that the v2.01 version is
>*faster*, not slower.  Please explain why do you think that the v2.01
>version is ``much slower''.

Hello Eli,

Sorry for the long time I took me to reply, but my mail server seems to 
have been on Christmas Holiday too, so I had to get your reply out of the 
mail archives.

You're completely right about those profiles. I know see that they can't 
be compared at all and that version 2.01 seems to be faster. But I'm 
still sure that the v2.01 version is a lot slower, because you notice 
it when running both versions. The v2.01 version responds slower to the 
keyboard commands and updates the screen at a lower frame rate.
This only happens when I use the -pg switch with compiling and linking, 
without profiling the v2.01 version runs fine.

I don't know if the differences in speed will show up in the profile, but 
it will be hard to get both version running the same time. In the v2.01 
version it takes about 10 seconds between the time I press Esc (the exit 
button) and the real exit of the program. In the v2.00 version the exit is
immediate.

I could try to write a function to exit the program when it's running for 
instance a minute, but I don't know if that will work.

Jordy Potman.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019