httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@apache.org
Subject cvs commit: httpd-2.0/modules/experimental cache_hash.c
Date Tue, 04 Jun 2002 20:33:15 GMT
stoddard    2002/06/04 13:33:15

  Modified:    modules/experimental cache_hash.c
  Log:
  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>
  
  Revision  Changes    Path
  1.7       +3 -3      httpd-2.0/modules/experimental/cache_hash.c
  
  Index: cache_hash.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/cache_hash.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- cache_hash.c	24 May 2002 14:41:08 -0000	1.6
  +++ cache_hash.c	4 Jun 2002 20:33:15 -0000	1.7
  @@ -82,7 +82,7 @@
   
   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 @@
   {
       cache_hash_entry_t **hep, *he;
       const unsigned char *p;
  -    int hash;
  +    unsigned int hash;
       apr_ssize_t i;
   
       /*
  @@ -257,7 +257,7 @@
       }
       
       /* 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 &&
  
  
  

Mime
View raw message