distribution in the hash table resulting in a 20% performance boost when
caching 6000+ files in a hash table with 512 collision chains.
Submitted by: Jean-Jacques Clar <jjclar@novell.com>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95512
13f79535-47bb-0310-9956-
ffa450edef68
struct cache_hash_entry_t {
cache_hash_entry_t *next;
- int hash;
+ unsigned int hash;
const void *key;
apr_ssize_t klen;
const void *val;
{
cache_hash_entry_t **hep, *he;
const unsigned char *p;
- int hash;
+ unsigned int hash;
apr_ssize_t i;
/*
}
/* scan linked list */
- for (hep = &ht->array[hash & ht->max], he = *hep;
+ for (hep = &ht->array[hash % ht->max], he = *hep;
he;
hep = &he->next, he = *hep) {
if (he->hash == hash &&