httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mladen Turk" <mt...@mappingsoft.com>
Subject RE: [PATCH] apr_table WAS: What to do about tables?
Date Mon, 12 Nov 2001 20:45:58 GMT


> -----Original Message-----
> From: Mladen Turk [mailto:mturk@mappingsoft.com]
> Sent: Monday, November 12, 2001 7:27 PM
> To: dev@httpd.apache.org
> Subject: RE: [PATCH] apr_table WAS: What to do about tables?
>
> -----Original Message-----
> > From: Brian Pane [mailto:Brian.Pane@cnet.com]
> > Sent: Monday, November 12, 2001 7:03 PM
> > To: 'dev@httpd.apache.org'
> > Subject: RE: [PATCH] apr_table WAS: What to do about tables?
> > By the way, I have an alternate implementation of a
> > table speedup that I wrote late yesterday.  It caches
> > a 32-bit checksum for each key in the table and compares
> > checksums to decide whether it can skip the strcasecmp.
> > It's still O(n), but the idea is to reduce the constant
> > multiplier.  (The checksum computation basically just
> > packs the first four bytes of the string into an int and
> > does some bit masking to normalize to all-uppercase.
> > I found that using a more expensive checksum, like strlen,
> > would slow down table performance overall, so I had to use
> > a very lightweight algorithm for the checksum.)  Once I
> > get some profile data, I'll post the code if it turns
> > out to be faster.

If we can trust that crc32 uniquely identifies keys than we can use the
following patch...
It would be nice because it's very simple and shows overall 10 times
performance increase.


MT.


Mime
View raw message