
richard.foley at rfi
Aug 12, 2013, 2:08 AM
Post #3 of 3
(6 views)
Permalink
|
|
Re: [perl #74650] perlperf.pod wrong example
[In reply to]
|
|
It's good to see this being looked at, and updated appropriately. Good job. -- Ciao Richard Foley http://www.rfi.net/books.html On Sun, Aug 11, 2013 at 05:26:28PM +0200, Daniel Pfeiffer wrote: > la 2013-08-11 06:26 James E Keenan via RT skribis: > > I have to admit that I'm not comfortable being asked to edit a patch > > originally submitted more than three years ago. I think we need additional > > eyeballs on Daniel's original critique of pod/perlperf.pod. Is the code > > example incorrect? If so, how do we improve it? Thank you very much. Jim Keenan > > Ok, I wondered about the join slice variant, so I've added it, but it performs > about as badly (once faster, twice slower) as the wrong code in perlperf. > I've also had to bump it to 10 million, to take modern computing power into > account. > > My criticism was and still is that the shown test doesn't test what it > pretends to. It talks about dereferencing strategies, but then shows a far > bigger performance loss, which instead comes from copying the 2 strings to > my-variables. That has nothing to do with the announced measurement, and > completely distorts it! Therefore I labelled it wrong and want it out of the doc. > > And I have the three-element variants for comparison. Because the whole test > is about a tradeoff between an extra copying operation versus dereferencing > for each access. As tradeoffs go, they depend heavily on the proportion. > When there are two accesses, the extra copy outweighs by about 3%, but at > three accesses it is already break even. That's because the extra copy is > constantly done once. > > 안녕히 계세요 / coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn > Daniel Pfeiffer > > -- > 배운다 / lerne / learn / apprends Esperanto: > http://lernu.net / http://ikurso.net > Reliability, Perl programming and much more in Makefiles: > http://makepp.sourceforge.net >
|