[GHC] #15418: Performance drop 60 times on non-profiling binary

GHC ghc-devs at haskell.org
Tue Jul 24 18:12:02 UTC 2018


#15418: Performance drop 60 times on non-profiling binary
-------------------------------------+-------------------------------------
        Reporter:  hth313            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.6.1
       Component:  Runtime System    |              Version:  8.4.3
      Resolution:                    |             Keywords:
Operating System:  MacOS X           |         Architecture:  x86_64
 Type of failure:  Runtime           |  (amd64)
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #14414, #9599     |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by hth313):

 Trying some low-tech profiling I compiled with `-debug` and ran in `lldb`,
 then stop using ctrl-c from time to time to see what it was up to. The
 following two are definitely main offenders, especically the second one.

 The first is the garbage collector in some way, I am not really sure what
 is going on in the second.

 {{{
 * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
   * frame #0: 0x000000010097d553
 tcc6502`countBlocks(bd=0x0000004202400fc0) at BlockAlloc.c:782
     frame #1: 0x0000000100988cd6 tcc6502`genBlocks(gen=0x0000000110c07528)
 at Sanity.c:870
     frame #2: 0x0000000100988fff tcc6502`memInventory(show=false) at
 Sanity.c:900
     frame #3: 0x00000001009821b8 tcc6502`GarbageCollect(collect_gen=0,
 do_heap_census=false, gc_type=0, cap=0x0000000101dc4500,
 idle_cap=0x0000000000000000) at GC.c:297
     frame #4: 0x00000001009730b9
 tcc6502`scheduleDoGC(pcap=0x00007ffeefbff770, task=0x0000000110c078a0,
 force_major=false) at Schedule.c:1809
     frame #5: 0x00000001009724d4
 tcc6502`schedule(initialCapability=0x0000000101dc4500,
 task=0x0000000110c078a0) at Schedule.c:558
     frame #6: 0x00000001009737d8
 tcc6502`scheduleWaitThread(tso=0x0000004200105388, ret=0x0000000000000000,
 pcap=0x00007ffeefbff870) at Schedule.c:2544
     frame #7: 0x000000010096a496
 tcc6502`rts_evalLazyIO(cap=0x00007ffeefbff870, p=0x0000000101d74e68,
 ret=0x0000000000000000) at RtsAPI.c:530
     frame #8: 0x000000010096d448 tcc6502`hs_main(argc=7,
 argv=0x00007ffeefbff9c8, main_closure=0x0000000101d74e68,
 rts_config=RtsConfig @ 0x00007ffeefbff890) at RtsMain.c:72
     frame #9: 0x000000010063eec6 tcc6502`main + 166
     frame #10: 0x00007fff692ec015 libdyld.dylib`start + 1
     frame #11: 0x00007fff692ec015 libdyld.dylib`start + 1
 }}}


 {{{
     frame #0: 0x00000001001105c4 tcc6502`c5kzn_info + 36
 tcc6502`c5kzn_info:
 ->  0x1001105c4 <+36>: leaq   0x888175(%rip), %rdx      ;
 stg_MUT_ARR_PTRS_DIRTY_info
     0x1001105cb <+43>: movq   %rdx, (%rbx)
     0x1001105ce <+46>: leaq   0x18(%rbx), %rdx
     0x1001105d2 <+50>: shrq   $0x7, %rax
 Target 0: (tcc6502) stopped.
 (lldb) bt
 * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
   * frame #0: 0x00000001001105c4 tcc6502`c5kzn_info + 36
     frame #1: 0x0000000109a19b60
 libclang.dylib`llvm::TargetLibraryInfoImpl::StandardNames + 896
     frame #2: 0x0000000108a6440b libclang.dylib
     frame #3: 0x0000000101d3f8c1
 tcc6502`TranslatorziTargetziMOS6502ziCompilerziRegister_RCzuY_closure + 1
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15418#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list