On Wed, Jan 30, 2013 at 05:42:06PM +0000, Tim Bunce wrote: > On Wed, Jan 30, 2013 at 04:21:44PM +0000, Dave Mitchell wrote: > > 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. > > I expect there are many macros and if()'s that have an obvious > LIKELY/UNLIKELY state for all but the most contrived workloads. Yeah. Just to be clear, I was pointing out the difficulties of automatic profiling: I expect it would usually be obvious when to apply UNLIKELY etc by hand. -- In economics, the exam questions are the same every year. They just change the answers.Thread Previous | Thread Next