Re: Initial patch for file suffix acl

From: Lucas Brasilino <lucas.brasilino@dont-contact.us>
Date: Mon, 03 Mar 2008 14:59:01 -0300

Hi Robert:

Ok. But I store file suffixes in a hash table ?
I can hash the url file suffix and check if it's
in table.

regards
Lucas Brasilino

> for sure. you have a linear scan, comparing all suffixes on all urls.
>
> if you assume a normal distribution, of the urls that fail, you will
> have compared all extensions
> and urls that match you will have compared 50% of the extensions on
> average
>
> checking a single extension requires checking (say) 4 characters
> if you have 20 extensions, thats 40 char checks (plus the memory hit to
> get the list)
>
> the same 20 extensions, with a good regex compiler should boil down to a
> single check for '.' at offset -4, then a single check for the number of
> unique next letters etc. basically a perfect tree rather than linear
> scan.
Received on Mon Mar 03 2008 - 11:00:03 MST

This archive was generated by hypermail pre-2.1.9 : Tue Apr 01 2008 - 13:00:10 MDT