Comparing strings is CS101. If map is a  linear search, that should be something to improve.

I'm assuming you read the code 


From: Robert Paprocki
Sent: Monday, November 14, 2016 8:56 AM
To: nginx@nginx.org
Reply To: nginx@nginx.org
Subject: Re: Bloking Bad bots



On Mon, Nov 14, 2016 at 8:51 AM, <li...@lazygranch.com> wrote:
I'd be shocked if the map function doesn't use a smart search scheme rather than check every item.  

You're in for a bit of a shock then. It is a linear search :p Curious as to what you think it should look like instead?

Getting back to the original question though, a map should (_should_) be faster than building a larger and larger regex, particularly if the map is doing string comparison as opposed to regex searching for each map member. Building large alternation-oriented regular expressions can get pretty expensive rather quickly, though some of that will depend on the regex engine and compile-time options (e.g, are you using PCRE JIT, etc).

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to