diff options
author | Sven Tennie <sven.tennie@gmail.com> | 2021-05-13 15:26:32 +0200 |
---|---|---|
committer | Sven Tennie <sven.tennie@gmail.com> | 2021-08-11 10:54:39 +0200 |
commit | ce2046fc61fffa9deb2b1240eee66f182572ed48 (patch) | |
tree | c9ac086d67f087dd35854707fd6252438445eb05 /rts/RtsStartup.c | |
parent | 8b9acc4d58f51dcbae73c8226ef876218809fd79 (diff) | |
download | haskell-wip/IPE_hashmap.tar.gz |
Optimize Info Table Provenance Entries (IPEs) Map creation and lookupwip/IPE_hashmap
Using a hash map reduces the complexity of lookupIPE(), making it non linear.
On registration each IPE list is added to a temporary IPE lists buffer, reducing
registration time. The hash map is built lazily on first lookup.
IPE event output to stderr is added with tests.
For details, please see
Note [The Info Table Provenance Entry (IPE) Map].
A performance test for IPE registration and lookup can be found here:
https://gitlab.haskell.org/ghc/ghc/-/merge_requests/5724#note_370806
Diffstat (limited to 'rts/RtsStartup.c')
-rw-r--r-- | rts/RtsStartup.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c index 371c96d08c..86d5b2f2d9 100644 --- a/rts/RtsStartup.c +++ b/rts/RtsStartup.c @@ -370,6 +370,7 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config) #if defined(PROFILING) initProfiling(); #endif + initIpeMapLock(); traceInitEvent(dumpIPEToEventLog); initHeapProfiling(); @@ -593,6 +594,8 @@ hs_exit_(bool wait_foreign) // Free threading resources freeThreadingResources(); + + closeIpeMapLock(); } // Flush stdout and stderr. We do this during shutdown so that it |