From 1d9a1d9fb8fe0a1fea2c44c4246f102ff3e1f3a3 Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Mon, 11 Feb 2019 17:40:00 +0100 Subject: NCG: fast compilation of very large strings (#16190) This patch adds an optimization into the NCG: for large strings (threshold configurable via -fbinary-blob-threshold=NNN flag), instead of printing `.asciz "..."` in the generated ASM source, we print `.incbin "tmpXXX.dat"` and we dump the contents of the string into a temporary "tmpXXX.dat" file. See the note for more details. --- docs/users_guide/using-optimisation.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'docs/users_guide/using-optimisation.rst') diff --git a/docs/users_guide/using-optimisation.rst b/docs/users_guide/using-optimisation.rst index cacc55325e..d6240bc5cb 100644 --- a/docs/users_guide/using-optimisation.rst +++ b/docs/users_guide/using-optimisation.rst @@ -1238,3 +1238,19 @@ by saying ``-fno-wombat``. if a function definition will be inlined *at a call site*. The other option determines if a function definition will be kept around at all for potential inlining. + +.. ghc-flag:: -fbinary-blob-threshold=⟨n⟩ + :shortdesc: *default: 500K.* Tweak assembly generator for binary blobs. + :type: dynamic + :category: optimization + + :default: 500000 + + The native code-generator can either dump binary blobs (e.g. string + literals) into the assembly file (by using ".asciz" or ".string" assembler + directives) or it can dump them as binary data into a temporary file which + is then included by the assembler (using the ".incbin" assembler directive). + + This flag sets the size (in bytes) threshold above which the second approach + is used. You can disable the second approach entirely by setting the + threshold to 0. -- cgit v1.2.1