On 11/22/2011 12:27 PM, David Schultz wrote:
> On Tue, Nov 22, 2011, Eitan Adler wrote:
>> The problem with profiling this type of change is that it is hard to
>> find a good representative benchmark. I could easily write code that
>> will show you that adding the equality check is a good idea or that it
>> is a horrible idea. IMHO it saves enough time when they are equal, but
>> loses almost no time when the strings are not equal.
> Benchmark or not, I think you'll have a very hard time finding a
> single real program that routinely calls strcasecmp() with
> identical pointers!
Agreed. Also, these changes seem to violate the general rule of "Don't
call a change an optimization unless you have benchmarks that
demonstrate that it actually is." The more critical the piece of code
you are modifying, the more important this rule is.
>> Is this the right course of action? Or should I just revert both
>> commits entirely?
Sorry to say, my vote would be to back them out. OTOH, I agree with
David that you should try not to let it discourage you.
"We could put the whole Internet into a book."
Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price. :) http://SupersetSolutions.com/