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
Showing
- compiler/utils/FastString.hs 148 additions, 87 deletionscompiler/utils/FastString.hs
- ghc/Main.hs 15 additions, 19 deletionsghc/Main.hs
- testsuite/tests/utils/Makefile 3 additions, 0 deletionstestsuite/tests/utils/Makefile
- testsuite/tests/utils/should_run/Makefile 3 additions, 0 deletionstestsuite/tests/utils/should_run/Makefile
- testsuite/tests/utils/should_run/T14854.hs 87 additions, 0 deletionstestsuite/tests/utils/should_run/T14854.hs
- testsuite/tests/utils/should_run/T14854.stdout 2 additions, 0 deletionstestsuite/tests/utils/should_run/T14854.stdout
- testsuite/tests/utils/should_run/all.T 7 additions, 0 deletionstestsuite/tests/utils/should_run/all.T
testsuite/tests/utils/Makefile
0 → 100644
testsuite/tests/utils/should_run/Makefile
0 → 100644
testsuite/tests/utils/should_run/T14854.hs
0 → 100644
testsuite/tests/utils/should_run/all.T
0 → 100644
Please register or sign in to comment