diff options
author | Tamar Christina <tamar@zhox.com> | 2017-10-03 14:55:28 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-10-03 16:25:07 -0400 |
commit | 8d647450655713e035091349d5163a1a28be18f4 (patch) | |
tree | 20d8986f1ae456f32682bcf7341913a507226c26 /docs/users_guide/8.4.1-notes.rst | |
parent | ec9ac20d0964c9f1323105b5a2df24f50d4fe3ef (diff) | |
download | haskell-8d647450655713e035091349d5163a1a28be18f4.tar.gz |
Optimize linker by minimizing calls to tryGCC to avoid fork/exec overhead.
On Windows process creations are fairly expensive. As such calling them in
what's essentially a hot loop is also fairly expensive.
Each time we make a call to `tryGCC` the following fork/exec/wait happen
```
gcc -> realgcc -> cc1
```
This is very problematic, because according to the profiler about 20% of the
time is spent on just process creation and spin time.
The goal of the patch is to mitigate this by asking GCC once for it's search
directories, caching these (because it's very hard to change these at all
after the process started since GCC's base dirs don't change unless with
extra supplied `-B` flags.).
We also do the same for the `findSysDll` function, since this computes
the search path every time by registery accesses etc.
These changes and D3909 drop GHC on Windows startup time from 2-3s to 0.5s.
The remaining issue is a 1.5s wait lock on `CONIN$` which can be addressed
with the new I/O manager code. But this makes GHCi as responsive on Windows as
GHC 7.8 was.
Test Plan: ./validate
Reviewers: austin, hvr, bgamari, erikd
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3910
Diffstat (limited to 'docs/users_guide/8.4.1-notes.rst')
-rw-r--r-- | docs/users_guide/8.4.1-notes.rst | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/docs/users_guide/8.4.1-notes.rst b/docs/users_guide/8.4.1-notes.rst index 142f9f9340..c9100d4d1e 100644 --- a/docs/users_guide/8.4.1-notes.rst +++ b/docs/users_guide/8.4.1-notes.rst @@ -173,6 +173,10 @@ Runtime system - The GHC runtime on Windows can now generate crash dumps on unhandled exceptions using the RTS flag :rts-flag:`--generate-crash-dumps`. +- The GHCi runtime linker now avoid calling GCC to find libraries as much as possible by caching + the list of search directories of GCC and querying the file system directly. This results in + much better performance, especially on Windows. + Template Haskell ~~~~~~~~~~~~~~~~ @@ -242,9 +246,3 @@ Build system There is currently no explicit dependency between the two in the build system and such there is no way to notify ``base`` that the ``rts`` has been split, or vice versa. (see :ghc-ticket:`5987`). - -- GHC now ships with a snapshot of the ``libffi`` library, which is used for - foreign function invocation on some platforms. This was necessary as there - were numerous fixes which have not yet been incorporated into a ``libffi`` - release. However, you can still use the ``--with-system-libffi`` ``configure`` - flag to tell the build system to use the ``libffi`` installed on your system. |