httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kraemer <Martin.Krae...@mch.sni.de>
Subject Re: misc profiling comments
Date Mon, 12 Jan 1998 23:02:14 GMT
On Sat, Jan 10, 1998 at 09:16:19PM -0800, Dean Gaudet wrote:
> I've got the beginnings of a hashed version of the table_* stuff.  It's
> not a full hash table, that would be too heavy.  There's too many tables,
> and the only "busy" ones are r->headers_in and r->headers_out (I wrote
> some code to monitor all the table ops).  I think I forgot to post this
> analysis. 

Is it worth thinking of the hsearch(3) or tsearch(3) library functions?
In the past, these proved to get us good speed improvements in similar
environments. But I think you had a even better performance in mind...

Is it worth thinking of calculating a perfect hash for the most frequently
used MIME headers (and always forcing them to single case)? Strcasecmp()
is IMHO much more expensive than strcmp().

> Rather than special case those two I'm putting an extra 32-bits (or maybe
> 64, whatever aligns it right) into the table header.  If a bit in the
> bitvector is 0, then it's known that no element matching that hash is in
> the table.  This gives a short-circuit for all the table functions.  I
> think it'll do the trick. 

Is that similar to the trick used in (t)csh? They pre-hash every directory
in the $PATH in order to provide speed improvements when trying to
execute commands (the don't even consider directories where the hash
claims the command cannot reside. That's why you have to say "rehash"
after adding commands).

    Martin
-- 
| S I E M E N S |  <Martin.Kraemer@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Mime
View raw message