Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: zm_mail [...] icloud.com
Cc:
AdminCc:

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



Subject: ++$ip is very slow
Date: Sat, 10 May 2014 00:12:13 +0800
To: bug-Net-IP [...] rt.cpan.org
From: mz <zm_mail [...] icloud.com>
Hi, The following example will spend about 4 minutes, but NetAddr::IP::Lite just spend 15 seconds in the same machine. I think Net::IP have a big space to optimize it. Thanks! my $ip = new Net::IP (‘195.45.0.0 - 195.45.254.254') || die; # Loop do { print $ip->ip(), "\n"; } while (++$ip);
On Fri May 09 12:12:36 2014, zm_mail@icloud.com wrote: Show quoted text
> Hi, > The following example will spend about 4 minutes, but > NetAddr::IP::Lite just spend 15 seconds in the same machine. I think > Net::IP have a big space to optimize it. Thanks!
That's true. Net::IP uses string representation of a bit field of IP address and operates on a string. Poor architectural decission, to be honest. Rewrite, though, may take too much efford. I'd recommend to use Net::IP::Lite instead.