#2466: Execution time mis-accounting
-------------------------+--------------------------------------------------
    Reporter:  heatsink  |       Owner:           
        Type:  bug       |      Status:  new      
    Priority:  normal    |   Component:  Profiling
     Version:  6.8.2     |    Severity:  normal   
    Keywords:            |    Testcase:           
Architecture:  x86       |          Os:  Linux    
-------------------------+--------------------------------------------------
 In the attached test case, profiling assigns a large fraction of run time
 to a single function.  The fraction ranges from 19% to 40% across runs.
 Although I haven't independently verified the profile, I believe execution
 time is mis-attributed to this function.

 The function in question is:

 {{{
 intersect :: Object -> Ray -> Maybe Intersection
 intersect obj@(Object dat mem) = objmIntersect mem dat obj
 }}}

 where `objmIntersect` is a field selector.  In `-ddump-simpl` output, the
 function consists of two case statements and a function call.  The
 function it calls has its own SCC.

 In profiling, this function is usually listed as the most time-consuming
 function in the program.  Its callee is assigned a similar amount of time.
 Both functions are called the same number of times.  The callee computes a
 ray-triangle intersection, which is presumably more time-consuming than
 two case statements and a function call...

 {{{
 COST CENTRE                    MODULE               %time %alloc

 intersect                      Datatypes             28.5   11.3
 triangle.intersect             Triangle              25.0    2.0
 (other functions...)
 }}}

 I've reduced the test case from a somewhat larger ray tracer.  I'm willing
 to help reduce it further if needed.  The test case depends on the
 [http://haskell.org/haskellwiki/Vector-space vector-space] library.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2466>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to