develooper Front page | perl.perl5.porters | Postings from January 2013

Re: use of LIKELY() and UNLIKELY() branch predictors

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
January 30, 2013 16:22
Subject:
Re: use of LIKELY() and UNLIKELY() branch predictors
Message ID:
20130130162144.GO2066@iabyn.com
On Tue, Jan 29, 2013 at 01:58:03PM -0500, bulk88 wrote:
> Dave Mitchell wrote:
> >Perl defines the LIKELY() and UNLIKELY() macros, which (under gcc)
> >tell the compiler whether a particular expression is likely to be true or
> >not. This allows you to re-write something like
> 
> Why do it by hand, rather than use
> http://en.wikipedia.org/wiki/Profile-guided_optimization with a real
> work load (what is a real workload?)?

Well, there's the rub. perl doesn't have a standard "workload" suite. The
test suite is specifically not useful for this sort of thing, since it
likes testing edge cases and exercising all those branches that would
normally not be taken.

And one person's "standard" workload is another person's atypical one.
Realistically, any profiling should be done by the end user on perl
running their own applications to build a perl optimised for their own
workload.

-- 
You live and learn (although usually you just live).

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About