summaryrefslogtreecommitdiff
path: root/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2019-08-17 18:35:09 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2019-08-17 18:35:09 +0100
commit5cff43d301b0773e2deeedb0a397da5e47cb89e1 (patch)
tree074d42d6a9cd8e82703b298d7f55b1078416dcd6 /compiler/llvmGen/LlvmCodeGen/CodeGen.hs
parent47e162374051ed3e874ed7916cc811df288cbd95 (diff)
downloadhaskell-wip/faststring-allocs.tar.gz
FastString: Reimplement in terms of pointer equalitywip/faststring-allocs
GHC allocates a lot of FastStrings when compiling so reducing the overhead of a FastString will result in a large decrease in allocations. Therefore we remove all the unecessary fields from the FastString. 1. Unique: Computed from the pointer 2. Equality: Computed directly by comparing the pointer 3. Length: Only used in 3 places, so the overhead is not worth it. 4. HasZEncoding: Caching the zencoding for a string should be localised to code generation rather than any consumer having to pay a large allocation penalty. Comparing pointer equality is safe as the string table guarantees that each string is only allocated once. As the memory is pinned, we don't have to worry about GC moving around the locations of the strings. Thanks to Jamie (Hanue) Willis for suggesting the idea of using pointer equality.
Diffstat (limited to 'compiler/llvmGen/LlvmCodeGen/CodeGen.hs')
0 files changed, 0 insertions, 0 deletions