diff options
author | Andy Wingo <wingo@pobox.com> | 2013-11-28 11:32:08 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-11-28 11:32:08 +0100 |
commit | 064d24093b752999979b4a71d19f60489c5dfc6a (patch) | |
tree | a8e3f7b76dbe3816c29e433f2a03cec26d48111e /libguile/gc.c | |
parent | a0a4d859c4101e41d669a62142a6ce1fb55d3a64 (diff) | |
download | guile-064d24093b752999979b4a71d19f60489c5dfc6a.tar.gz |
Tune initial heap size
* libguile/fluids.c (new_fluid): Don't run an explicit GC for the first
fluid.
* libguile/gc.c (DEFAULT_INITIAL_HEAP_SIZE, scm_storage_prehistory):
Enlarge from 32 kB to 512 or 1024 kB, depending on word size. Reduces
startup time by 10 or 15% by avoiding excessive
GC.
* libguile/private-gc.h: Remove SCM_DEFAULT_INIT_HEAP_SIZE_2 definition
here.
Diffstat (limited to 'libguile/gc.c')
-rw-r--r-- | libguile/gc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libguile/gc.c b/libguile/gc.c index e822f49fb..dc7f5b0b5 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -70,6 +70,12 @@ extern unsigned long * __libc_ia64_register_backing_store_base; #include <unistd.h> #endif +/* Size in bytes of the initial heap. This should be about the size of + result of 'guile -c "(display (assq-ref (gc-stats) + 'heap-total-allocated))"'. */ + +#define DEFAULT_INITIAL_HEAP_SIZE (128 * 1024 * SIZEOF_SCM_T_BITS) + /* Set this to != 0 if every cell that is accessed shall be checked: */ int scm_debug_cell_accesses_p = 0; @@ -593,7 +599,7 @@ scm_storage_prehistory () GC_INIT (); - GC_expand_hp (SCM_DEFAULT_INIT_HEAP_SIZE_2); + GC_expand_hp (DEFAULT_INITIAL_HEAP_SIZE); /* We only need to register a displacement for those types for which the higher bits of the type tag are used to store a pointer (that is, a |