• Sylvain Henry's avatar
    TH: support raw bytes literals (#14741) · 224a6b86
    Sylvain Henry authored
    GHC represents String literals as ByteString internally for efficiency
    reasons. However, until now it wasn't possible to efficiently create
    large string literals with TH (e.g. to embed a file in a binary, cf #14741):
    TH code had to unpack the bytes into a [Word8] that GHC then had to re-pack
    into a ByteString.
    
    This patch adds the possibility to efficiently create a "string" literal
    from raw bytes. We get the following compile times for different sizes
    of TH created literals:
    
    || Size || Before || After  || Gain ||
    || 30K  || 2.307s || 2.299  || 0%   ||
    || 3M   || 3.073s || 2.400s || 21%  ||
    || 30M  || 8.517s || 3.390s || 60%  ||
    
    Ticket #14741 can be fixed if the original code uses this new TH feature.
    224a6b86
Name
Last commit
Last update
.circleci Loading commit data...
.gitlab Loading commit data...
bindisttest Loading commit data...
compiler Loading commit data...
distrib Loading commit data...
docs Loading commit data...
driver Loading commit data...
ghc Loading commit data...
hadrian Loading commit data...
includes Loading commit data...
libffi Loading commit data...
libffi-tarballs @ 96d02800 Loading commit data...
libraries Loading commit data...
mk Loading commit data...
nofib @ 7a702cc1 Loading commit data...
rts Loading commit data...
rules Loading commit data...
testsuite Loading commit data...
utils Loading commit data...
.appveyor.sh Loading commit data...
.ghcid Loading commit data...
.gitignore Loading commit data...
.gitlab-ci.yml Loading commit data...
.gitmodules Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
ANNOUNCE Loading commit data...
CODEOWNERS Loading commit data...
HACKING.md Loading commit data...
INSTALL.md Loading commit data...
LICENSE Loading commit data...
MAKEHELP.md Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
Vagrantfile Loading commit data...
aclocal.m4 Loading commit data...
appveyor.yml Loading commit data...
boot Loading commit data...
build.nix.sh Loading commit data...
config.guess Loading commit data...
config.sub Loading commit data...
configure.ac Loading commit data...
ghc.mk Loading commit data...
install-sh Loading commit data...
llvm-passes Loading commit data...
llvm-targets Loading commit data...
packages Loading commit data...
settings.in Loading commit data...
validate Loading commit data...