Decrease initial size of symbol cache hash table
Using 2^23 allocates 128MB memory for the hash table. Seems like a waste of memory, especially for small scripts. For example, I didn't notice a huge difference in time between 1000 and the old number when compiling most of YSI includes and tests. Hash tables double in size when they need more space, it's pretty efficient (at least this implementation does so).
This commit is contained in:
parent
c4e15a032a
commit
6d65605bb0
@ -937,7 +937,7 @@ static void initglobals(void)
|
||||
litq=NULL; /* the literal queue */
|
||||
glbtab.next=NULL; /* clear global variables/constants table */
|
||||
loctab.next=NULL; /* " local " / " " */
|
||||
hashmap_init(&symbol_cache_map,hashmap_hash_string,hashmap_compare_string,8388608); /* 2^23 */
|
||||
hashmap_init(&symbol_cache_map,hashmap_hash_string,hashmap_compare_string,10000);
|
||||
tagname_tab.next=NULL; /* tagname table */
|
||||
libname_tab.next=NULL; /* library table (#pragma library "..." syntax) */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user