Author pmoody
Recipients benjamin.peterson, drkjam, giampaolo.rodola, gvanrossum, loewis, mattsmart, pmoody, shields, vstinner
Date 2009-01-01.01:08:13
SpamBayes Score 3.58946e-07
Marked as misclassified No
Message-id <1230772099.62.0.283432939327.issue3959@psf.upfronthosting.co.za>
In-reply-to
Content
I'm biased ;) but I don't see what netaddr provides over ipaddr.  it
also seems to be in the neighborhood of 50% slower (at least on my mac
mini).

pmoody@mini - 04:52 PM - ~/Downloads/ipaddr-1.0.1
-> python -m timeit 'import ipaddr;\
ipaddr.IP("1.1.1.1")'
10000 loops, best of 3: 46.2 usec per loop

pmoody@mini - 04:52 PM - ~/Downloads/netaddr-0.5.2
-> python -m timeit 'import netaddr;\
netaddr.IP("1.1.1.1")'
10000 loops, best of 3: 71.9 usec per loop

dealing with netmasks, the difference is even greater.
pmoody@mini - 04:52 PM - ~/Downloads/ipaddr-1.0.1
-> python -m timeit 'import ipaddr;\
ipaddr.IP("1.1.1.1/255.255.255.0")'
10000 loops, best of 3: 78.4 usec per loop

pmoody@mini - 04:49 PM - ~/Downloads/netaddr-0.5.2
-> python -m timeit 'import netaddr;\
> netaddr.IP("1.1.1.1/255.255.255.0")'
1000 loops, best of 3: 247 usec per loop

(and it doesn't seem to deal with hostsmasked addresses).

it also seems to be layed out in an unintuitive way, treating address
ranges a something very different than network addresses. hopefully
someone who isn't intimately familiar with both libraries can comment,
but ipaddr feels a lot cleaner to me.
History
Date User Action Args
2009-01-01 01:08:20pmoodysetrecipients: + pmoody, gvanrossum, loewis, vstinner, giampaolo.rodola, benjamin.peterson, mattsmart, shields, drkjam
2009-01-01 01:08:19pmoodysetmessageid: <1230772099.62.0.283432939327.issue3959@psf.upfronthosting.co.za>
2009-01-01 01:08:17pmoodylinkissue3959 messages
2009-01-01 01:08:15pmoodycreate