summaryrefslogtreecommitdiff
path: root/hadrian/build.stack.sh
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2019-05-27 20:52:02 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-09-09 05:42:33 -0400
commit4cf91d1abc0232ef6b85f44dfb2bb025ab0c70b0 (patch)
tree78370707e68114af6a1e75c2a0b4fd2da65e98fb /hadrian/build.stack.sh
parentd0b45ac6984f245bce9de7ffcc7dad4a0046d344 (diff)
downloadhaskell-4cf91d1abc0232ef6b85f44dfb2bb025ab0c70b0.tar.gz
Use lazyness for FastString's z-encoding memoization
Having an IORef in FastString to memoize the z-encoded version is unecessary because there is this amazing thing Haskell can do natively, it's called "lazyness" :) We simply remove the UNPACK and strictness annotations from the constructor field corresponding to the z-encoding, making it lazy, and store the (pure) z-encoded string there. The only complication here is 'hasZEncoding' which allows cheking if a z-encoding was computed for a given string. Since this is only used for compiler performance statistics though it's not actually necessary to have the current per-string granularity. Instead I add a global IORef counter to the FastStringTable and use unsafePerformIO to increment the counter whenever a lazy z-encoding is forced.
Diffstat (limited to 'hadrian/build.stack.sh')
0 files changed, 0 insertions, 0 deletions