Hi! We have a custom linux OS running in a virtual machine (64-bit), with perl 5.10.1
We’ve been using NYTProf to profile our code, and changing from multiplication to addition reduced the time spent in this call by a factor of 2 (137920 executions takes 4.18 seconds instead of 12.0 seconds).
Thanks for the suggestion to shift left! I’ll give that a shot too.
On 3/14/17, 5:38 PM, "Timur I. Bakeyev via RT" <bug-Net-IP@rt.cpan.org> wrote:
<URL:
https://rt.cpan.org/Ticket/Display.html?id=120624 >
Hi, Brian!
On Tue Mar 14 14:40:26 2017, britterm@cisco.com wrote:
Show quoted text > $n *= 2;
> This is about twice as slow as this:
> $n += $n;
Can I get the details about how did you run your benchmarks, on which OS, CPU and Perl version?
I, seems, can't get any notable difference in the performance of those two code lines. Alternative with the:
$n <<= 1;
Is slightly quicker, but ATM I'm not certain that this method will give same results in the all edge cases.