On Tue, Nov 22, 2011 at 12:27 PM, David Schultz <d...@freebsd.org> 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!

At this point I'd like to mention ministat(1).

What you do is generate a series of timed runs, both with and without
a given change.  Record the times in two files.

Then have ministat show you an analysis to give you an overview to
show if you are really onto something or if you're just messing around
in statistical noise.

ministat(1) is far from the last word, but it gives valuable clues
whenever somebody wants to talk about an "optimization".

-- 
Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV
"All of this is for nothing if we don't go to the stars" - JMS/B5
"If Java had true garbage collection, most programs would delete
themselves upon execution." -- Robert Sewell
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to