diff options
author | Sven Tennie <sven.tennie@gmail.com> | 2021-05-13 15:26:32 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-08-11 18:14:30 -0400 |
commit | f5fdace5613914724eb00bcf7547c82f3ad12686 (patch) | |
tree | eeaeb36a5b79192c19eed847a2663e13fbf8b1f8 /rts/include | |
parent | c65a7ffa7d8962f769bfe1dfbad20e32e1709c20 (diff) | |
download | haskell-f5fdace5613914724eb00bcf7547c82f3ad12686.tar.gz |
Optimize Info Table Provenance Entries (IPEs) Map creation and lookup
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/include')
-rw-r--r-- | rts/include/rts/IPE.h | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/rts/include/rts/IPE.h b/rts/include/rts/IPE.h index 81a6d553d0..07026979d8 100644 --- a/rts/include/rts/IPE.h +++ b/rts/include/rts/IPE.h @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------------- * - * (c) The GHC Team, 2017-2018 + * (c) The GHC Team, 2017-2021 * * IPE API * @@ -13,23 +13,19 @@ #pragma once - -typedef struct InfoProv_{ - char * table_name; - char * closure_desc; - char * ty_desc; - char * label; - char * module; - char * srcloc; +typedef struct InfoProv_ { + char *table_name; + char *closure_desc; + char *ty_desc; + char *label; + char *module; + char *srcloc; } InfoProv; typedef struct InfoProvEnt_ { - StgInfoTable * info; + StgInfoTable *info; InfoProv prov; - struct InfoProvEnt_ *link; } InfoProvEnt; -extern InfoProvEnt * RTS_VAR(IPE_LIST); // registered IP list - void registerInfoProvList(InfoProvEnt **cc_list); -InfoProvEnt * lookupIPE(StgInfoTable *info); +InfoProvEnt *lookupIPE(StgInfoTable *info); |