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 <1421617991.99.0.818777386848.issue23266@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
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: <1421617991.99.0.818777386848.issue23266@psf.upfronthosting.co.za>
2015-01-18 21:53:11serhiy.storchakalinkissue23266 messages
2015-01-18 21:53:11serhiy.storchakacreate