httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Akins <>
Subject Re: [PATCH] mod_disk_cache: speed up read_table
Date Thu, 18 Aug 2005 16:11:56 GMT
Colm MacCarthaigh wrote:

> Thinking about it, everything is going into memory anyway, so why not
> just stat() the file and read it all in in one go? 

Yes! Brilliant.  We need all that data anyway.


open file.

length = get_info

read_full(file, length).

manipulate pointers for table (apr_table_addn)

> If we try really hard, a table_serialize() and table_unserialize() could
> just cut up the strings and user pointer-manipulation to escape even the
> need for a subpool destory.

That's basically what I was doing.

> Yep, but there are definite speed-up's to be had. I'm going to
> canibalise your patch and try some of the above anyway.

Cool. I'd be willing to help.

On a side note, maybe interesting: what if the whole file was just 
mmaped? (use '\0' for delimiter in tables).  This would allow every 
worker referencing an object to reference the same memory.  I did some 
testing with our caching module and it was not very efficient, but it is 
structure differently.  Should be fairly easy to try: replace the alloc 
and read with a mmap.

Brian Akins
Lead Systems Engineer
CNN Internet Technologies

View raw message