Speed up handling of large String literals
The idea would to try the following optimization for literal strings by adding a pass in the simplifier that does:
- detect large string literals (> 2KB maybe? we would need to find a threshold)
- append large strings into a temporary binary file, remember their offset and size
- include the binary file into the compilation chain using ".incbin" in an assembler file (see the details here: https://hsyl20.fr/home/posts/2019-01-15-fast-file-embedding-with-ghc.html); add a fresh global module-specific symbol for the file, say "largestrings"
- replace
Lit (Literal (LitString LARGE_BYTESTRING))
expressions withunpackNBytes# (plusAddr (CLabel "largestrings") offset) size
Trac metadata
Trac field | Value |
---|---|
Version | 8.6.3 |
Type | Task |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |