[commit: ghc] master: Rewrite FastString table in concurrent hashtable (5126764)

git at git.haskell.org git at git.haskell.org
Sun Oct 28 17:41:41 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/5126764be614cc43b435e3f5ff34ea593c30269a/ghc

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

commit 5126764be614cc43b435e3f5ff34ea593c30269a
Author: Zejun Wu <watashi at fb.com>
Date:   Sun Oct 28 12:39:58 2018 -0400

    Rewrite FastString table in concurrent hashtable
    
    Summary:
    Reimplement global FastString table using a concurrent hashatable with
    fixed size segments and dynamically growing buckets instead of fixed size
    buckets.
    
    This addresses the problem that `mkFastString` was not linear when the
    total number of entries was large.
    
    Test Plan:
    ./validate
    
    ```
    inplace/bin/ghc-stage2 --interactive -dfaststring-stats < /dev/null
    GHCi, version 8.7.20181005: http://www.haskell.org/ghc/  :? for help
    Prelude> Leaving GHCi.
    FastString stats:
        segments:          256
        buckets:           16384
        entries:           7117
        largest segment:   64
        smallest segment:  64
        longest bucket:    5
        has z-encoding:    0%
    ```
    
    Also comapre the two implementation using
    
    {P187}
    
    The new implementation is on a par with the old version with different
    conbination of parameters and perform better when the number of
    FastString's are large.
    
    {P188}
    
    Reviewers: simonmar, bgamari, niteria
    
    Reviewed By: simonmar, bgamari
    
    Subscribers: rwbarton, carter
    
    GHC Trac Issues: #14854
    
    Differential Revision: https://phabricator.haskell.org/D5211


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

5126764be614cc43b435e3f5ff34ea593c30269a
 compiler/utils/FastString.hs                       | 235 +++++++++++++--------
 ghc/Main.hs                                        |  34 ++-
 testsuite/tests/{ado => utils}/Makefile            |   0
 .../should_compile => utils/should_run}/Makefile   |   0
 testsuite/tests/utils/should_run/T14854.hs         |  87 ++++++++
 .../tests/utils/should_run/T14854.stdout           |   0
 testsuite/tests/utils/should_run/all.T             |   7 +
 7 files changed, 257 insertions(+), 106 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 5126764be614cc43b435e3f5ff34ea593c30269a


More information about the ghc-commits mailing list