diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2020-05-23 00:14:17 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-06-10 04:17:06 -0400 |
commit | 9454511b0bdfcd79a1899d7f24bf65a3eb0d06e3 (patch) | |
tree | b94b338a862db912e19cd20af7e0b6bd5c320ae0 /compiler/GHC/Rename/Unbound.hs | |
parent | 3b22b14a7a1c1819fc8682fc127acf7448c5630c (diff) | |
download | haskell-9454511b0bdfcd79a1899d7f24bf65a3eb0d06e3.tar.gz |
Optimisation in Unique.Supply
This patch switches on -fno-state-hack in GHC.Types.Unique.Supply.
It turned out that my fixes for #18078 (coercion floating) changed the
optimisation pathway for mkSplitUniqSupply in such a way that we had
an extra allocation inside the inner loop. Adding -fno-state-hack
fixed that -- and indeed the loop in mkSplitUniqSupply is a classic
example of the way in which -fno-state-hack can be bad; see #18238.
Moreover, the new code is better than the old. They allocate
the same, but the old code ends up with a partial application.
The net effect is that the test
perf/should_run/UniqLoop
runs 20% faster! From 2.5s down to 2.0s. The allocation numbers
are the same -- but elapsed time falls. Good!
The bad thing about this is that it's terribly delicate. But
at least it's a good example of such delicacy in action.
There is a long Note [Optimising the unique supply] which now
explains all this.
Diffstat (limited to 'compiler/GHC/Rename/Unbound.hs')
0 files changed, 0 insertions, 0 deletions