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"
Lit (Literal (LitString LARGE_BYTESTRING))expressions with
unpackNBytes# (plusAddr (CLabel "largestrings") offset) size