www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/06/04/20:30:06

Message-ID: <3B1C2662.A2575F0D@mail.rosecom.ca>
From: April <awhite AT mail DOT rosecom DOT ca>
X-Mailer: Mozilla 4.75 [en]C-CCK-MCD {TLC;RETAIL} (Win95; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: gprof question
Lines: 90
Date: Mon, 04 Jun 2001 20:22:58 -0400
NNTP-Posting-Host: 205.189.215.9
X-Trace: client 991700656 205.189.215.9 (Mon, 04 Jun 2001 20:24:16 EDT)
NNTP-Posting-Date: Mon, 04 Jun 2001 20:24:16 EDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

--------------4578454969EC75959D5EBEFB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I've started trying to improve my program - a btree program - using the
output of gprof.

I compiled the program without optimization - I learned that hard way
that
functions inlined were not reported.

This is the top of the output of gprof:

  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
 65.73     31.22    31.22                             __dpmi_int
 11.70     36.78     5.56                             __dj_movedata
  3.04     38.22     1.44                             mcount
  2.92     39.61     1.39  1708128     0.00     0.00  KeyGet
  1.99     40.56     0.94   916869     0.00     0.00  NodeCopy

These results were from inserting 20000 random words into the btree.  I
was quite impressed with the number of calls to KeyGet, but I was
equally shocked by the amount of time reported for __dpmi_int.

info simply states:

    This function performs a software interrupt in real mode after
filling
    in *most* the registers from the given structure.

I realize that this is a very ambiguous question, but what generally
causes these interrupts to fire?  The program runs for about 50 seconds,
and more than 30 seconds apparently are taken up by calls to this
interrupt.  If I can acertain what causes it to fire, I might be able to
alter my code and reduce this significant overhead - I hope :-)

Thanks.

April

--------------4578454969EC75959D5EBEFB
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<tt>I've started trying to improve my program - a btree program - using
the</tt>
<br><tt>output of gprof.</tt><tt></tt>
<p><tt>I compiled the program without optimization - I learned that hard
way that</tt>
<br><tt>functions inlined were not reported.</tt><tt></tt>
<p><tt>This is the top of the output of gprof:</tt><tt></tt>
<p><tt>&nbsp; %&nbsp;&nbsp; cumulative&nbsp;&nbsp; self&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
self&nbsp;&nbsp;&nbsp;&nbsp; total</tt>
<br><tt>&nbsp;time&nbsp;&nbsp; seconds&nbsp;&nbsp; seconds&nbsp;&nbsp;&nbsp;
calls&nbsp; ms/call&nbsp; ms/call&nbsp; name</tt>
<br><tt>&nbsp;65.73&nbsp;&nbsp;&nbsp;&nbsp; 31.22&nbsp;&nbsp;&nbsp; 31.22&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
__dpmi_int</tt>
<br><tt>&nbsp;11.70&nbsp;&nbsp;&nbsp;&nbsp; 36.78&nbsp;&nbsp;&nbsp;&nbsp;
5.56&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
__dj_movedata</tt>
<br><tt>&nbsp; 3.04&nbsp;&nbsp;&nbsp;&nbsp; 38.22&nbsp;&nbsp;&nbsp;&nbsp;
1.44&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mcount</tt>
<br><tt>&nbsp; 2.92&nbsp;&nbsp;&nbsp;&nbsp; 39.61&nbsp;&nbsp;&nbsp;&nbsp;
1.39&nbsp; 1708128&nbsp;&nbsp;&nbsp;&nbsp; 0.00&nbsp;&nbsp;&nbsp;&nbsp;
0.00&nbsp; KeyGet</tt>
<br><tt>&nbsp; 1.99&nbsp;&nbsp;&nbsp;&nbsp; 40.56&nbsp;&nbsp;&nbsp;&nbsp;
0.94&nbsp;&nbsp; 916869&nbsp;&nbsp;&nbsp;&nbsp; 0.00&nbsp;&nbsp;&nbsp;&nbsp;
0.00&nbsp; NodeCopy</tt><tt></tt>
<p><tt>These results were from inserting 20000 random words into the btree.&nbsp;
I was quite impressed with the number of calls to KeyGet, but I was equally
shocked by the amount of time reported for __dpmi_int.</tt><tt></tt>
<p><tt>info simply states:</tt><tt></tt>
<p><tt>&nbsp;&nbsp;&nbsp; This function performs a software interrupt in
real mode after filling</tt>
<br><tt>&nbsp;&nbsp;&nbsp; in *most* the registers from the given structure.</tt><tt></tt>
<p><tt>I realize that this is a very ambiguous question, but what generally
causes these interrupts to fire?&nbsp; The program runs for about 50 seconds,
and more than 30 seconds apparently are taken up by calls to this interrupt.&nbsp;
If I can acertain what causes it to fire, I might be able to alter my code
and reduce this significant overhead - I hope :-)</tt><tt></tt>
<p><tt>Thanks.</tt><tt></tt>
<p><tt>April</tt></html>

--------------4578454969EC75959D5EBEFB--

- Raw text -


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