pike.git/src/program.c:86:
*
* Further measurements seems to indicate that this cache can slow
* things down a bit if the hit/miss rate is not fairly high.
* For normal applications, the hitrate is most likely well over 90%,
* but that should be verified.
* - Holistiska Centralbyrån (Hubbe)
*/
/* Define the size of the cache that is used for method lookup. */
/* A value of zero disables this cache */
- #define FIND_FUNCTION_HASHSIZE 15013
+ #define FIND_FUNCTION_HASHSIZE 16384
/* Programs with less methods will not use the cache for method lookups.. */
#define FIND_FUNCTION_HASH_TRESHOLD 9
#define DECLARE
#include "compilation.h"
struct pike_string *this_program_string;
static struct pike_string *this_string, *this_function_string;
pike.git/src/program.c:6429: Inside #if defined(FIND_FUNCTION_HASHSIZE)
#ifdef FIND_FUNCTION_HASHSIZE
if(prog -> flags & PROGRAM_FIXED
#if FIND_FUNCTION_HASH_TRESHOLD - 0
&& prog->num_identifier_index >= FIND_FUNCTION_HASH_TRESHOLD
#endif
)
{
size_t hashval;
hashval = my_hash_string(name);
hashval += prog->id;
- hashval %= FIND_FUNCTION_HASHSIZE;
+ hashval &= (FIND_FUNCTION_HASHSIZE-1);
if(is_same_string(cache[hashval].name,name) &&
cache[hashval].id==prog->id)
return cache[hashval].fun;
if(cache[hashval].name) free_string(cache[hashval].name);
copy_shared_string(cache[hashval].name,name);
cache[hashval].id=prog->id;
return cache[hashval].fun=low_find_shared_string_identifier(name,prog);
}
#endif /* FIND_FUNCTION_HASHSIZE */