httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Akins <>
Subject [PATCH] mod_disk_cache: speed up read_table
Date Thu, 18 Aug 2005 13:02:03 GMT
This one's kinda ugly.

Rather than rely on apr_file_gets, this stores the total length of the 
tables, then the serialized table in store_table.  In read_table, it 
reads this length, allocs that amount, and reads the headers into the 
buffer.  Then it just uses memchr to "parse" it into a table.

I didn't mess with the EBCDIC stuff, so alot of the patch is just where 
I commented all that out.

I also commented out where the headers file is opened buffered.  It is 
faster on my tests boxen (Linux 2.6) to use unbuffered (probably because 
at lease pagesize if being buffered anyway).  YMMV on this one.

Anyway, I got a nice 5-8% increase in all my benchmarks by using this 

Brian Akins
Lead Systems Engineer
CNN Internet Technologies

View raw message