[GHC] #10739: Resuscitate the humble ticky-ticky profiler

#10739: Resuscitate the humble ticky-ticky profiler -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- The [https://ghc.haskell.org/trac/ghc/wiki/Debugging/TickyTicky ticky- ticky profiler] is known to be quite bit-rotted. Indeed there currently isn't even a definitive list of the counters, much less what they counter and whether they are still accurate. That being said, it can be quite useful and is worth putting effort into bringing back up to grade. There are a few things that need to be done here, 1. Collect a list of the existing counters 2. Work out what they are supposed to be measuring 3. Decide which still have a chance of being useful and accurate 4. ??? 5. Profile! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10739 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10739: Resuscitate the humble ticky-ticky profiler -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by bgamari): Today I added a list of the existing counters to the [https://ghc.haskell.org/trac/ghc/wiki/Debugging/TickyTicky#Ticky- Tickycounters Ticky-Ticky page]. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10739#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10739: Resuscitate the humble ticky-ticky profiler -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Description changed by bgamari: Old description:
The [https://ghc.haskell.org/trac/ghc/wiki/Debugging/TickyTicky ticky- ticky profiler] is known to be quite bit-rotted. Indeed there currently isn't even a definitive list of the counters, much less what they counter and whether they are still accurate. That being said, it can be quite useful and is worth putting effort into bringing back up to grade.
There are a few things that need to be done here,
1. Collect a list of the existing counters 2. Work out what they are supposed to be measuring 3. Decide which still have a chance of being useful and accurate 4. ??? 5. Profile!
New description: The [https://ghc.haskell.org/trac/ghc/wiki/Debugging/TickyTicky ticky- ticky profiler] is known to be quite bit-rotted. Indeed there currently isn't even a definitive list of the counters, much less what they counter and whether they are still accurate. That being said, it can be quite useful and is worth putting effort into bringing back up to grade. There are a few things that need to be done here, 1. Collect a list of the existing counters 2. Work out what they are supposed to be measuring 3. Decide which still have a chance of being useful and accurate 4. Fix the counters as necessary 5. ??? 6. Profile! -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10739#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10739: Resuscitate the humble ticky-ticky profiler -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): Ticky-ticky is tremendously useful when debugging performance, because it gives repeatable counts, and it guarantees not to affect optimisation. Bringing it back up to snuff would be a Very Good Thing. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10739#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10739: Resuscitate the humble ticky-ticky profiler -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Profiling | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #8308, #9405 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * component: Compiler => Profiling * related: => #8308, #9405 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10739#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10739: Resuscitate the humble ticky-ticky profiler -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Profiling | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #8308, #9405 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): I've spent much of today trying to correlate Ticky's results with the RTS's allocation counters and at this point I strongly suspect that there is a rather large discrepancy. Specifically, I've been trying to track down an apparent regression in `haddock`'s allocations due to Phab:D2038. Here I observe, ||= =||= Ticky's `ALLOC_HEAP_ctr` =||= Ticky's `ALLOC_HEAP_tot` =||= RTS `Bytes allocated` =|| || *before D2038* || 174007560 || 9357869592 || 23809691712 || || *after D2038* || 174243649 || 9365165304 || 27690978448 || That is, while the RTS's `bytes allocated` metric regresses by around 15%, Ticky's allocation counter only appears to regress by ~1%. Moreover, I am unable to find any large regression in the per-closure counters. It's all very unfortunate. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10739#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10739: Resuscitate the humble ticky-ticky profiler -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Profiling | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #8308, #9405 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Please ignore comment:5; the problem was that I had neglected to pass `-ticky` to the stage1 compiler when it built `base` et al. Consequently a large fraction of the code linked into my executable lacked ticky instrumentation. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10739#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10739: Resuscitate the humble ticky-ticky profiler -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: task | Status: new Priority: normal | Milestone: Component: Profiling | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #8308, #9405 | Differential Rev(s): Phab:D5392 Wiki Page: | -------------------------------------+------------------------------------- Changes (by sgraf): * differential: => Phab:D5392 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10739#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10739: Resuscitate the humble ticky-ticky profiler -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: task | Status: new Priority: normal | Milestone: Component: Profiling | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #8308, #9405 | Differential Rev(s): Phab:D5392 Wiki Page: | -------------------------------------+------------------------------------- Comment (by sgraf): Just for future references: I think at least `ENT_DYN_THK_MANY_ctr` and `UPDF_PUSHED_ctr` are flawed. I discovered this while inspecting improvements in `queens` to due `-fstg-lift-lams`. With `-fno-stg-lift-lams`, these counters go down, which should not be the case since we don't ever destroy sharing or introduce any kind of additional thunks (like partial applications). On the other hand, this could happen because we no longer can use one of the generic apply functions (like `stg_ap_2`) after lifting, which AFAIK aren't represented at all in ticky numbers. Either way: Fix these counters by - Not using generic apply functions with `-ticky` - Identify and fix accidental misascription like in Phab:D5392 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10739#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC