Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Nov 2011 15:56:06 -0800
From:      Peter Wemm <peter@wemm.org>
To:        Eitan Adler <eadler@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org, bde@freebsd.org, theraven@freebsd.org,  dim@freebsd.org, Brooks Davis <brooks@freebsd.org>
Subject:   Re: svn commit: r227812 - head/lib/libc/string
Message-ID:  <CAGE5yCpnNvv-Y6%2BJ4%2BTn75-aK2v6O_QW6Qy1i3Mkc6qqSbMTpg@mail.gmail.com>
In-Reply-To: <20111122202735.GA21442@zim.MIT.EDU>
References:  <201111220250.pAM2oPWC070856@svn.freebsd.org> <20111122153332.GA20145@zim.MIT.EDU> <CAF6rxgmPeZCZ3c0xbd-4riqvLHob8U9eWG25R8P6FG2BjTfyyA@mail.gmail.com> <20111122202735.GA21442@zim.MIT.EDU>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Nov 22, 2011 at 12:27 PM, David Schultz <das@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@wemm.org; peter@FreeBSD.org; peter@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGE5yCpnNvv-Y6%2BJ4%2BTn75-aK2v6O_QW6Qy1i3Mkc6qqSbMTpg>