You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "William A. Rowe, Jr." <wr...@rowe-clan.net> on 2001/08/06 22:43:50 UTC

Re: [PATCH] mod_mime performance tweaks, revised

From: "Brian Pane" <bp...@pacbell.net>
Sent: Wednesday, June 27, 2001 11:50 AM


> I've revised my mod_mime optimization patch a bit
> to try to speed up the merge-per-dir-config implementation.
> This patch replaces the previous one that I posted.  (That's the
> last of my changes, I promise, until somebody reviews this
> one :-)

Brian,

  As you can guess, the recent mime and negotation fixes entirely broke this patch :(

  I won't have much time until next Tuesday, but I'd be happy to review and then
commit the idea, based on a couple of significant restrictions;

1. the order of suffixes _must_ remain constant.
   That is, if the user asks for something.html.en, they cannot be served 
   something.en.html.  If they ask for simply something, something.html, or
   something.en, I'd be happy if we serve something.html.en or something.en.html
   based on negotation (if they both existed, the smaller would win.)

2. the negotation exception-list code needs to be changed to check the exceptions
   list one segment at a time against the segments the user requested, also in the 
   same sequence.  So asking for index.bak might return index.html.en.bak, or even
   index.bak.html.en, but asking for index.html can _never_ find index.bak since
   the .bak extension isn't recognized by mod_mime.

  So if you will fix the patch against these requirements, I'm +1, and will review
and commit if nobody objects, sometime early next week (cc wrowe at rowe-clan.net so
it ends up on my priority stack, I'll be catching up on a ton of email Monday.)

Bill



Re: [PATCH] mod_mime performance tweaks, revised

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: "Brian Pane" <bp...@pacbell.net>
Sent: Monday, August 06, 2001 10:13 PM


> William A. Rowe, Jr. wrote:
> 
> >From: "Brian Pane" <bp...@pacbell.net>
> >Sent: Monday, August 06, 2001 4:51 PM
> >
> >
> >>The patch in question got committed a long time ago, back in version
> >>1.43 of mod_mime.c.  I checked the current rev in CVS, and it's still
> >>using the hash tables that my patch introduced.
> >>
> >
> >Ahhh.  I thought you offered a further patch to allow just segments of the filename
> >to be matched, so that index.en would match index.html.en.  I must have been imagining
> >things :)
> 
> I bet you're thinking of the patch I posted to optimize away the
> ap_getword calls in mod_mime (which wasn't committed).  That
> one definitely won't work with the latest mod_mime code.  I'll
> see if I can do the same optimization (replace ap_getword with
> inline string-scanning to eliminate some string-copying) against
> the current code base; if it works, I'll post a patch.

Actually, once updated, it will work better.  It can solve the tangle of index.html.unk.en
not being served when the user requests index.html.unk because it can recognize that the
user asked for both index and unk.  Right now, it strcmp's index.unk (the unknown bits)
to index.html.unk, and will die.

If it makes the original patch simpler/lighter, I do insist we will only parse elements
forward, so a request for index.html.en can't return index.en.html (two very different
names.)  If we can agree on that, your patch should be very fast :)

Bill


Re: [PATCH] mod_mime performance tweaks, revised

Posted by Brian Pane <bp...@pacbell.net>.
William A. Rowe, Jr. wrote:

>From: "Brian Pane" <bp...@pacbell.net>
>Sent: Monday, August 06, 2001 4:51 PM
>
>
>>The patch in question got committed a long time ago, back in version
>>1.43 of mod_mime.c.  I checked the current rev in CVS, and it's still
>>using the hash tables that my patch introduced.
>>
>
>Ahhh.  I thought you offered a further patch to allow just segments of the filename
>to be matched, so that index.en would match index.html.en.  I must have been imagining
>things :)
>
I bet you're thinking of the patch I posted to optimize away the
ap_getword calls in mod_mime (which wasn't committed).  That
one definitely won't work with the latest mod_mime code.  I'll
see if I can do the same optimization (replace ap_getword with
inline string-scanning to eliminate some string-copying) against
the current code base; if it works, I'll post a patch.

--Brian


Re: [PATCH] mod_mime performance tweaks, revised

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: "Brian Pane" <bp...@pacbell.net>
Sent: Monday, August 06, 2001 4:51 PM


> The patch in question got committed a long time ago, back in version
> 1.43 of mod_mime.c.  I checked the current rev in CVS, and it's still
> using the hash tables that my patch introduced.

Ahhh.  I thought you offered a further patch to allow just segments of the filename
to be matched, so that index.en would match index.html.en.  I must have been imagining
things :)

Bill

> William A. Rowe, Jr. wrote:
> 
> >  I won't have much time until next Tuesday, but I'd be happy to review and then
> >commit the idea, based on a couple of significant restrictions;
> >
> >1. the order of suffixes _must_ remain constant.
> >   That is, if the user asks for something.html.en, they cannot be served 
> >   something.en.html.  If they ask for simply something, something.html, or
> >   something.en, I'd be happy if we serve something.html.en or something.en.html
> >   based on negotation (if they both existed, the smaller would win.)
> >
> >2. the negotation exception-list code needs to be changed to check the exceptions
> >   list one segment at a time against the segments the user requested, also in the 
> >   same sequence.  So asking for index.bak might return index.html.en.bak, or even
> >   index.bak.html.en, but asking for index.html can _never_ find index.bak since
> >   the .bak extension isn't recognized by mod_mime.
> >
> >  So if you will fix the patch against these requirements, I'm +1, and will review
> >and commit if nobody objects, sometime early next week (cc wrowe at rowe-clan.net so
> >it ends up on my priority stack, I'll be catching up on a ton of email Monday.)
> >
> >Bill
> >
> >
> >
> 
> 
> 
> 


Re: [PATCH] mod_mime performance tweaks, revised

Posted by Brian Pane <bp...@pacbell.net>.
The patch in question got committed a long time ago, back in version
1.43 of mod_mime.c.  I checked the current rev in CVS, and it's still
using the hash tables that my patch introduced.

--Brian

William A. Rowe, Jr. wrote:

>From: "Brian Pane" <bp...@pacbell.net>
>Sent: Wednesday, June 27, 2001 11:50 AM
>
>
>>I've revised my mod_mime optimization patch a bit
>>to try to speed up the merge-per-dir-config implementation.
>>This patch replaces the previous one that I posted.  (That's the
>>last of my changes, I promise, until somebody reviews this
>>one :-)
>>
>
>Brian,
>
>  As you can guess, the recent mime and negotation fixes entirely broke this patch :(
>
>  I won't have much time until next Tuesday, but I'd be happy to review and then
>commit the idea, based on a couple of significant restrictions;
>
>1. the order of suffixes _must_ remain constant.
>   That is, if the user asks for something.html.en, they cannot be served 
>   something.en.html.  If they ask for simply something, something.html, or
>   something.en, I'd be happy if we serve something.html.en or something.en.html
>   based on negotation (if they both existed, the smaller would win.)
>
>2. the negotation exception-list code needs to be changed to check the exceptions
>   list one segment at a time against the segments the user requested, also in the 
>   same sequence.  So asking for index.bak might return index.html.en.bak, or even
>   index.bak.html.en, but asking for index.html can _never_ find index.bak since
>   the .bak extension isn't recognized by mod_mime.
>
>  So if you will fix the patch against these requirements, I'm +1, and will review
>and commit if nobody objects, sometime early next week (cc wrowe at rowe-clan.net so
>it ends up on my priority stack, I'll be catching up on a ton of email Monday.)
>
>Bill
>
>
>