Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,391
    • Issues 4,391
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 375
    • Merge Requests 375
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #2466

Closed
Open
Opened Jul 25, 2008 by red5_2@hotmail.com@trac-red5_2

Execution time mis-accounting

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 vector-space library.

Trac metadata
Trac field Value
Version 6.8.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Profiling
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
7.4.1
Milestone
7.4.1
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#2466