Re: Initial patch for file suffix acl

From: Lucas Brasilino <lucas.brasilino@dont-contact.us>
Date: Tue, 04 Mar 2008 09:24:12 -0300

Hi Amos

> * strrchr() is probably the better for finding the '.'
> the forward-search is likely to be on average slower than the
> reverse-search. Particularly for objects without parameters which are
> in the majority.
> * strlen(l->key) is relatively quite slow and CPU intensive. If possible
> it needs to be moved outside the core while-loop. Probably by basing the
> strncmp length on the tested files ext (or ACL_FILE_SUFFIX_SZ) than on the
> key.
> * with the above ACL_FILE_SUFFIX_SZ would be useful then to limit the
> scanning time as well as the config parsing.

   hmmm great idea!

> * ACL_FILE_SUFFIX_SZ should be linked with the appropriate RFC defining
> the URI part limits instead of an arbitrary 10. I think its likely to be
> in either RFC2181 or RFC1123.

   I have just looked suffixes(7) man page to get an idea of suffix max
length.

> * If you want to test for speed, test the difference between a wordlist
> and a splay tree. The output of strncmp is suitable for the splay test and
> splay allows a larger scaling over ACL length. Long-term in squid a better
> tree entirely is probably needed for string comparisons.

   I gonna take a look at splay tree implementation. Don't you think a
hash table is more suitable for this kind of searching?

regards
Lucas Brasilino
Received on Tue Mar 04 2008 - 05:25:18 MST

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