Message234382
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 |
|
Date |
User |
Action |
Args |
2015-01-20 19:03:10 | cmn | set | recipients:
+ cmn, pitrou, pmoody, python-dev, serhiy.storchaka |
2015-01-20 19:03:10 | cmn | set | messageid: <1421780590.7.0.770117808651.issue23266@psf.upfronthosting.co.za> |
2015-01-20 19:03:10 | cmn | link | issue23266 messages |
2015-01-20 19:03:10 | cmn | create | |
|