
#9577: String literals are wasting space -------------------------------------+------------------------------------- Reporter: xnyhps | Owner: xnyhps Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.8.2 (NCG) | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: Runtime | Related Tickets: performance bug | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rwbarton): If I have a server today that serves a large literal ByteString in response to a particular request, presumably that string buffer will get copied out of at some point—maybe even by the kernel. That memcpy probably won't have statically known size or alignment but it probably will determine at runtime that the size is large and alignment is suitable for doing a more efficient copy. Replying to [comment:10 xnyhps]:
Alternatively, using the same heuristic as GCC would also be an option: align only ≥32 byte strings. (`genCCall` has a maximum length it will unroll, but I can't tell what that practically is on x86.)
I think we should just do this (at least for now). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9577#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler