apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dean gaudet <d...@arctic.org>
Subject tables -> hash (Re: Observations on fragmentation in SMS pools)
Date Tue, 10 Jul 2001 08:21:33 GMT
On Mon, 9 Jul 2001, Roy T. Fielding wrote:

> > Tables are in APR, because were originally moved from Apache to APR before
> > APR-util existed.  They should really move to apr-util.  They should never
> > be removed from Apache.  Tables are useful because they garuantee a
> > general order to the data, namely, the order you insert information into
> > the table.  Hashes have a different use case.
>
> Ummm, no, tables do not guarantee that -- arrays do.  Tables were specfically
> created to be an abstract hash table, but the implementation remained
> simple because we never used them for large tables.

the r->headers_{in,out,err} tables are referenced so frequently that
making them hash tables is a win... there was a russian fellow, dimitri? i
forget his last name -- works on freebsd as well i think.  he tried this
and said it was a win.

i did a hash implementation for tables, but it was a loss because the hash
overhead on the zillion other small tables kills you.

but if you just fix mod_mime (Brian's patch is a start :), and the
headers_{in,out,err} then you get the biggest bang.  (btw,
headers_{in,out,err} should be turned into a perfect hash using gperf...
and all the compile-time string constants such as "Connection",
"Accept-Types", ... should become integers with #defines.)

-dean


Mime
View raw message