From 90329b6cc183b3cd05956ae6bdeb6ac6951549c2 Mon Sep 17 00:00:00 2001 From: Johan Tibell Date: Sun, 23 Mar 2014 12:06:56 +0100 Subject: Add SmallArray# and SmallMutableArray# types These array types are smaller than Array# and MutableArray# and are faster when the array size is small, as they don't have the overhead of a card table. Having no card table reduces the closure size with 2 words in the typical small array case and leads to less work when updating or GC:ing the array. Reduces both the runtime and memory allocation by 8.8% on my insert benchmark for the HashMap type in the unordered-containers package, which makes use of lots of small arrays. With tuned GC settings (i.e. `+RTS -A6M`) the runtime reduction is 15%. Fixes #8923. --- rts/ClosureFlags.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'rts/ClosureFlags.c') diff --git a/rts/ClosureFlags.c b/rts/ClosureFlags.c index 020f28438a..c43437dc04 100644 --- a/rts/ClosureFlags.c +++ b/rts/ClosureFlags.c @@ -81,9 +81,13 @@ StgWord16 closure_flags[] = { [ATOMICALLY_FRAME] = ( _BTM ), [CATCH_RETRY_FRAME] = ( _BTM ), [CATCH_STM_FRAME] = ( _BTM ), - [WHITEHOLE] = ( 0 ) + [WHITEHOLE] = ( 0 ), + [SMALL_MUT_ARR_PTRS_CLEAN] = (_HNF| _NS| _MUT|_UPT ), + [SMALL_MUT_ARR_PTRS_DIRTY] = (_HNF| _NS| _MUT|_UPT ), + [SMALL_MUT_ARR_PTRS_FROZEN0] = (_HNF| _NS| _MUT|_UPT ), + [SMALL_MUT_ARR_PTRS_FROZEN] = (_HNF| _NS| _UPT ) }; -#if N_CLOSURE_TYPES != 61 +#if N_CLOSURE_TYPES != 65 #error Closure types changed: update ClosureFlags.c! #endif -- cgit v1.2.1