diff options
author | Joachim Breitner <mail@joachim-breitner.de> | 2021-10-15 10:38:23 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-10-19 03:30:52 -0400 |
commit | 7271bf78a9ffd865e590f1ce3f3ae975f5dc1a49 (patch) | |
tree | 4c1eb9dbf7c3698f4462ae9fa7d7ac13ef89eb9e /rts/xxhash.h | |
parent | 753b921da52c0b7da21856c5fe0bf4604505c7b3 (diff) | |
download | haskell-7271bf78a9ffd865e590f1ce3f3ae975f5dc1a49.tar.gz |
InteractiveContext: Smarter caching when rebuilding the ic_rn_gbl_env
The GlobalRdrEnv of a GHCI session changes in odd ways: New bindings are
not just added "to the end", but also "in the middle", namely when
changing the set of imports: These are treated as if they happened
before all bindings from the prompt, even those that happened earlier.
Previously, this meant that the `ic_rn_gbl_env` is recalculated from the
`ic_tythings`. But this wasteful if `ic_tythings` has many entries that
define the same unqualified name. By separately keeping track of a
`GlobalRdrEnv` of all the locally defined things we can speed this
operation up significantly.
This change improves `T14052Type` by 60% (It used to be 70%, but it
looks that !6723 already reaped some of the rewards).
But more importantly, it hopefully unblocks #20455, becaues with this
smarter caching, the change needed to fix that issue will no longer make
`T14052` explode. I hope.
It does regress `T14052` by 30%; caching isn’t free. Oh well.
Metric Decrease:
T14052Type
Metric Increase:
T14052
Diffstat (limited to 'rts/xxhash.h')
0 files changed, 0 insertions, 0 deletions