Skip Menu |

This queue is for tickets about the Net-IP CPAN distribution.

Report information
The Basics
Id: 120624
Status: open
Priority: 0/
Queue: Net-IP

People
Owner: Nobody in particular
Requestors: britterm [...] cisco.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: ip_bintoint is slower than it needs to be
Date: Tue, 14 Mar 2017 18:38:35 +0000
To: "bug-Net-IP [...] rt.cpan.org" <bug-Net-IP [...] rt.cpan.org>
From: "Brian Rittermann (britterm)" <britterm [...] cisco.com>
Performance improvement: The function ip_bintoint runs the following code: $n *= 2; This is about twice as slow as this: $n += $n; Thanks, Brian Rittermann
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.
Subject: Re: [rt.cpan.org #120624] ip_bintoint is slower than it needs to be
Date: Tue, 14 Mar 2017 23:50:16 +0000
To: "bug-Net-IP [...] rt.cpan.org" <bug-Net-IP [...] rt.cpan.org>
From: "Brian Rittermann (britterm)" <britterm [...] cisco.com>
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.