<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[gprof] Was bedeuten die Spalten?]]></title><description><![CDATA[<p>Hallo,<br />
ich hab hier ein Programm, das ich mit grpof analysiert habe:</p>
<pre><code>Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls   s/call   s/call  name    
 44.82      0.56     0.56    97994     0.00     0.00  CFleet::SSE_Subtract(std::vector&lt;int, alignment_allocator&lt;int, 16&gt; &gt;&amp;, unsigned long, int)
 18.41      0.79     0.23   701069     0.00     0.00  CFleet::GetShipAtPos(int, int*)
  8.80      0.90     0.11   701069     0.00     0.00  CShip::Fire(CShip*)
  8.00      1.00     0.10   701069     0.00     0.00  CFightSimulator::PlayerShoot(int, int, int)
  7.20      1.09     0.09   701069     0.00     0.00  CShield::AbsorbDamage(int*, CWeapon*)
  3.20      1.13     0.04   701089     0.00     0.00  CTimer::Stop()
  3.20      1.17     0.04    97994     0.00     0.00  CFleet::ClearShip(int)
  1.60      1.19     0.02   701089     0.00     0.00  CTimer::Restart()
  1.60      1.21     0.02   701069     0.00     0.00  mersenne_genrand_int32()
  1.60      1.23     0.02        1     0.02     1.23  CFightSimulator::Run()
  0.80      1.24     0.01        4     0.00     0.00  CFleet::AddShip(char const*, int)
  0.80      1.25     0.01                             _DPRINT(int, char*, ...)
  0.00      1.25     0.00  1500274     0.00     0.00  _DPRINTL(int, char*, ...)
</code></pre>
<p>Mein Problem ist, dass ich die Spalten nicht so wirklich alle kapier. Die erste (% time) ist ja klar. die zweite (culmutativ seconds) auch (einfach die Summe von &quot;self seconds&quot; aller vorherigen Funktionen, wobei ich in der Angabe jetzt keinen großen Sinn sehe...). Die 3. Spalte &quot;self seconds&quot; würde ich ja auch kapieren. Allerdings gibts da ein kleines logisches Problem. &quot;self seconds&quot; ist ja die Zeit, die das Programm in der einen Funktion verbracht hat. Also müsste die summe aller self seconds die Ausführungszeit ergeben. Tut sie aber nicht: Mein Programm hat für die ausführung 20 Sekunden gebraucht, die Summe aller &quot;self seconds&quot; ist allerdings nur 1,25 Sekunden.<br />
Wie ist das zu erklären???</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/183582/gprof-was-bedeuten-die-spalten</link><generator>RSS for Node</generator><lastBuildDate>Thu, 02 Jul 2026 19:00:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/183582.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 06 Jun 2007 12:59:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [gprof] Was bedeuten die Spalten? on Wed, 06 Jun 2007 12:59:45 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich hab hier ein Programm, das ich mit grpof analysiert habe:</p>
<pre><code>Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls   s/call   s/call  name    
 44.82      0.56     0.56    97994     0.00     0.00  CFleet::SSE_Subtract(std::vector&lt;int, alignment_allocator&lt;int, 16&gt; &gt;&amp;, unsigned long, int)
 18.41      0.79     0.23   701069     0.00     0.00  CFleet::GetShipAtPos(int, int*)
  8.80      0.90     0.11   701069     0.00     0.00  CShip::Fire(CShip*)
  8.00      1.00     0.10   701069     0.00     0.00  CFightSimulator::PlayerShoot(int, int, int)
  7.20      1.09     0.09   701069     0.00     0.00  CShield::AbsorbDamage(int*, CWeapon*)
  3.20      1.13     0.04   701089     0.00     0.00  CTimer::Stop()
  3.20      1.17     0.04    97994     0.00     0.00  CFleet::ClearShip(int)
  1.60      1.19     0.02   701089     0.00     0.00  CTimer::Restart()
  1.60      1.21     0.02   701069     0.00     0.00  mersenne_genrand_int32()
  1.60      1.23     0.02        1     0.02     1.23  CFightSimulator::Run()
  0.80      1.24     0.01        4     0.00     0.00  CFleet::AddShip(char const*, int)
  0.80      1.25     0.01                             _DPRINT(int, char*, ...)
  0.00      1.25     0.00  1500274     0.00     0.00  _DPRINTL(int, char*, ...)
</code></pre>
<p>Mein Problem ist, dass ich die Spalten nicht so wirklich alle kapier. Die erste (% time) ist ja klar. die zweite (culmutativ seconds) auch (einfach die Summe von &quot;self seconds&quot; aller vorherigen Funktionen, wobei ich in der Angabe jetzt keinen großen Sinn sehe...). Die 3. Spalte &quot;self seconds&quot; würde ich ja auch kapieren. Allerdings gibts da ein kleines logisches Problem. &quot;self seconds&quot; ist ja die Zeit, die das Programm in der einen Funktion verbracht hat. Also müsste die summe aller self seconds die Ausführungszeit ergeben. Tut sie aber nicht: Mein Programm hat für die ausführung 20 Sekunden gebraucht, die Summe aller &quot;self seconds&quot; ist allerdings nur 1,25 Sekunden.<br />
Wie ist das zu erklären???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1300020</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1300020</guid><dc:creator><![CDATA[XCooperation]]></dc:creator><pubDate>Wed, 06 Jun 2007 12:59:45 GMT</pubDate></item><item><title><![CDATA[Reply to [gprof] Was bedeuten die Spalten? on Sat, 09 Jun 2007 18:39:24 GMT]]></title><description><![CDATA[<p><a href="http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html#SEC1" rel="nofollow">http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html#SEC1</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1302181</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1302181</guid><dc:creator><![CDATA[Prof84]]></dc:creator><pubDate>Sat, 09 Jun 2007 18:39:24 GMT</pubDate></item><item><title><![CDATA[Reply to [gprof] Was bedeuten die Spalten? on Sun, 10 Jun 2007 01:07:17 GMT]]></title><description><![CDATA[<p>Die &quot;self time&quot; ist schon das was du denkst, also die Zeit die direkt in der Funktion verbraten wird, ohne die Zeit die in aufgerufenen Unterfunktionen verbraucht wird.</p>
<p>Zu den 20 Sek. vs. 1,25 Sek.: das wird wohl daran liegen dass der Profiler einen ziemlichen Overhead hat, also Zeit die draufgeht beim Abspeichern von Anfangs-/Endzeit einer Funktion etc.<br />
Normalerweise rechnet das ein Profiler raus, zeigt also nur das an was nicht Overhead vom Profiler selbst ist. Dadurch ist die Summe aller &quot;self time&quot;s dann eben wesentlich kleiner als die tatsächliche Laufzeit.</p>
<p>Wäre sonst auch ziemlich doof, da der Overhead normalerweise pro Funktionsaufruf konstant ist. D.h. Funktionen die sehr sehr schnell laufen (&quot;return 1;&quot;) würden grob benachteiligt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1302270</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1302270</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sun, 10 Jun 2007 01:07:17 GMT</pubDate></item></channel></rss>