svn commit: r227812 - head/lib/libc/string
peter at wemm.org
Tue Nov 22 23:56:08 UTC 2011
On Tue, Nov 22, 2011 at 12:27 PM, David Schultz <das at 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 - peter at wemm.org; peter at FreeBSD.org; peter at 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
More information about the svn-src-head