delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/11/04/12:33:25

Date: Thu, 4 Nov 1999 17:09:55 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: infinity girl <entropic AT mpx DOT com DOT au>
cc: djgpp AT delorie DOT com
Subject: Re: mcount, and gprof
In-Reply-To: <38215F61.35BDEC90@mpx.com.au>
Message-ID: <Pine.SUN.3.91.991104170333.14397C-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 4 Nov 1999, infinity girl wrote:

> i was profiling a program today, and i would just like to know which
> library functions call 
> "mcount"?

`mcount' is part of the profiling mechanism, it is called on every timer 
tick while your program runs.

> my  program spends alot of time there.

How much is ``alot''?  Is it 100%?

If so, this is probably due to a known bug in the itimer module in DJGPP
v2.02.  Usually, `mcount' does not appear at all in the profile, because
the profiler removes it.  There is a source-level patch on the DJGPP 
bug-tracking system, http://www.delorie.com/djgpp/bugs/; if you fix your 
itimer module and rebuild the program, the problem should go away.

> also, i was wondering if there is any way of making profiled programs
> run faster...i am profiling a text compression/decompression program,
> and it usually takes 11 seconds to compress a 2MB file, but with
> profiling it took over half an hour

What CPU do you have?

Profiling makes the program run slower, but not by such a large factor as 
you report.  It should be less than 2 times slower, in my experience.

> i understand there is alot of overhead..

No, the overhead is not so large.

How did you compile and link the program?  What compiler switches did you 
use?  Did you request line-level profiling?

- Raw text -


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