This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients cmn, pitrou, pmoody, python-dev, serhiy.storchaka
Date 2015-01-18.21:53:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Deduplication should not be omitted. This slowed down collapsing of duplicated addresses.

$ ./python -m timeit -s "import ipaddress; ips = [ipaddress.ip_address('2001:db8::1000') for i in range(1000)]" -- "ipaddress.collapse_addresses(ips)"

Before f7508a176a09:
100 loops, best of 3: 13.4 msec per loop

After f7508a176a09:
10 loops, best of 3: 129 msec per loop

Proposed patch restores performance for duplicated addresses and simplifies the code using generators.
Date User Action Args
2015-01-18 21:53:12serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, pmoody, python-dev, cmn
2015-01-18 21:53:11serhiy.storchakasetmessageid: <>
2015-01-18 21:53:11serhiy.storchakalinkissue23266 messages
2015-01-18 21:53:11serhiy.storchakacreate