[commit: ghc] ghc-7.10: Fix quadratic behaviour in tidyOccName (9b406cc)

git at git.haskell.org git at git.haskell.org
Tue Jun 2 19:24:12 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/9b406cc65cdb5db6b294a63301aed52a02bcbaf5/ghc

>---------------------------------------------------------------

commit 9b406cc65cdb5db6b294a63301aed52a02bcbaf5
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri May 22 14:46:51 2015 +0100

    Fix quadratic behaviour in tidyOccName
    
    In the test program from comment:3 of Trac #10370, it turned out
    that 25% of all compile time was going in OccName.tidyOccName!
    
    It was all becuase the algorithm for finding an unused OccName
    had a quadratic case.
    
    This patch fixes it.  THe effect is pretty big:
    
    Before:
    	total time  =       34.30 secs   (34295 ticks @ 1000 us, 1 processor)
    	total alloc = 15,496,011,168 bytes  (excludes profiling overheads)
    
    After
    	total time  =       25.41 secs   (25415 ticks @ 1000 us, 1 processor)
    	total alloc = 11,812,744,816 bytes  (excludes profiling overheads)
    
    (cherry picked from commit c89bd681d34d3339771ebdde8aa468b1d9ab042b)


>---------------------------------------------------------------

9b406cc65cdb5db6b294a63301aed52a02bcbaf5
 compiler/basicTypes/OccName.hs                     | 57 +++++++++++++++++-----
 compiler/typecheck/TcMType.hs                      |  2 -
 compiler/types/TypeRep.hs                          |  2 +
 .../tests/ghci.debugger/scripts/print027.stdout    |  6 +--
 testsuite/tests/parser/should_fail/T7848.stderr    |  2 +-
 .../tests/simplCore/should_compile/T7360.stderr    | 16 +++---
 6 files changed, 58 insertions(+), 27 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 9b406cc65cdb5db6b294a63301aed52a02bcbaf5


More information about the ghc-commits mailing list