Commit 5b5f8120 authored by Bill Stoddard's avatar Bill Stoddard
Browse files

Jean-Jacques is reporting that this change dramatically improves the

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
parent c06c2027
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ typedef struct cache_hash_entry_t cache_hash_entry_t;

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;
@@ -203,7 +203,7 @@ static cache_hash_entry_t **find_entry(cache_hash_t *ht,
{
    cache_hash_entry_t **hep, *he;
    const unsigned char *p;
    int hash;
    unsigned int hash;
    apr_ssize_t i;

    /*
@@ -257,7 +257,7 @@ static cache_hash_entry_t **find_entry(cache_hash_t *ht,
    }
    
    /* 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 &&