Boost logo

Boost-Build :

From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2006-07-27 09:42:51


Sending to the list as I still can't send email to Volodya directly...

-------- Original Message --------
Subject: Re: [Boost-build] Profiling code question
Date: Thu, 27 Jul 2006 08:29:25 -0500

Vladimir Prus wrote:
> On Thursday 27 July 2006 17:10, Rene Rivera wrote:
>> Vladimir Prus wrote:
>>> Hi,
>>> I'm still surprised by our profiling output. Here's what I see when
>>> sorted by "net" time:
>>>
>>> --count-- --gross-- --net-- --name--
>>> 3.56E+06 2.62E+06 2.62E+06 [OTHER]
>>> 82,825.00 9.60E+05 250,000.00 FILE_DIRSCAN
>>> 138,826.00 3.50E+05 230,000.00 BUILTIN_GLOB_BACK
>>>
>>>
>>> So, most of the net time is spent in "OTHER".
>>>
>>> 1. What's exactly that?
>> It's basically the hashing. Specifically hashitem() in "hash.c".
>
> Given that hashing typically happens when looking up variables inside some
> rules, would not it be better to attribute those times to rules? This way, I
> have no idea which rules actually use that much hashing.

Sure... but it's not possible code wise. It's a recursive dependency
problem where the perf code uses a hashtable for storing the per rule
perf data. That is hashitem() can't use itself to record the perf of the
data. Probably the best we can do is turn off the measurement of
hashitem() so that the time gets attributed to whomever calls
hashitem(), which may or may not be a jam rule. There a defined at the
top of hash.c just for that which need to be commented out:

Index: tools/jam/src/hash.c
===================================================================
RCS file: /cvsroot/boost/boost/tools/jam/src/hash.c,v
retrieving revision 1.5
diff -u -r1.5 hash.c
--- tools/jam/src/hash.c 3 Oct 2005 00:47:36 -0000 1.5
+++ tools/jam/src/hash.c 27 Jul 2006 13:28:12 -0000
@@ -26,7 +26,7 @@
   * 4/29/93 - ensure ITEM's are aligned
   */

-/* */
+/* *
  #define HASH_DEBUG_PROFILE 1
  /* */

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk