zend_accelerator_util_funcs.c lines 79 and 84 initialise the hash tables for the persistent script function and class tables to 128 and 16 size_t slots for the arBuckets vector. What is the rationale here? These tables are allocated in emalloc space and grown to complete size there before being copied to SMA in zend_persist.c. This copy is based on the nTableSize not the nNumOfElements, so in the case of the function table 1K will be allocated (on 64bit builds) even though only a few top level functions are defined.
OK, the 128/16 sizing potentially saves few HashTable resizes during initial compilation (once-per-compile) (a few μS) but at a cost of 1K/128 bytes space in per script/function loaded into SMA at runtime. OK this is relative small beer, but it is unnecessary wasted space nonetheless.
Why not just use the default 8 and save the space in the SMA?
zend_accelerator_util_funcs.c lines 79 and 84 initialise the hash tables for the persistent script function and class tables to 128 and 16 size_t slots for the arBuckets vector. What is the rationale here? These tables are allocated in emalloc space and grown to complete size there before being copied to SMA in zend_persist.c. This copy is based on the nTableSize not the nNumOfElements, so in the case of the function table 1K will be allocated (on 64bit builds) even though only a few top level functions are defined.
OK, the 128/16 sizing potentially saves few HashTable resizes during initial compilation (once-per-compile) (a few μS) but at a cost of 1K/128 bytes space in per script/function loaded into SMA at runtime. OK this is relative small beer, but it is unnecessary wasted space nonetheless.
Why not just use the default 8 and save the space in the SMA?