diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2019-02-11 17:40:00 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-02-14 02:29:54 -0500 |
commit | 1d9a1d9fb8fe0a1fea2c44c4246f102ff3e1f3a3 (patch) | |
tree | 4abf3da5c8a8d5fdd88903613d2ce42346e4943f /docs/users_guide | |
parent | 0f1eb88c93143359fa671bb72aceebc299c87a95 (diff) | |
download | haskell-1d9a1d9fb8fe0a1fea2c44c4246f102ff3e1f3a3.tar.gz |
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.
Diffstat (limited to 'docs/users_guide')
-rw-r--r-- | docs/users_guide/using-optimisation.rst | 16 |
1 files changed, 16 insertions, 0 deletions
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. |