Author cmn
Recipients cmn, pitrou, pmoody, python-dev, serhiy.storchaka
Date 2015-01-20.19:03:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1421780590.7.0.770117808651.issue23266@psf.upfronthosting.co.za>
In-reply-to
Content
My initial patch was wrong wrt. _find_address_range.
It did not loop over equal addresses.
Thats why performance with many equal addresses was degraded when dropping the set().

Here is a patch to fix _find_address_range, drop the set, and improve performance again.

python3 -m timeit -s "import bipaddress; ips = [bipaddress.ip_address('2001:db8::1000') for i in range(1000)]" -- "bipaddress.collapse_addresses(ips)"
1000 loops, best of 3: 1.76 msec per loop

python3 -m timeit -s "import aipaddress; ips = [aipaddress.ip_address('2001:db8::1000') for i in range(1000)]" -- "aipaddress.collapse_addresses(ips)"
1000 loops, best of 3: 1.32 msec per loop
History
Date User Action Args
2015-01-20 19:03:10cmnsetrecipients: + cmn, pitrou, pmoody, python-dev, serhiy.storchaka
2015-01-20 19:03:10cmnsetmessageid: <1421780590.7.0.770117808651.issue23266@psf.upfronthosting.co.za>
2015-01-20 19:03:10cmnlinkissue23266 messages
2015-01-20 19:03:10cmncreate