You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2014-05-23.21:12:52.731>created_at=<Date2014-05-15.21:24:37.802>labels= ['library', 'performance']
title='speed up some ipaddress properties'updated_at=<Date2014-05-23.21:12:52.729>user='https://github.com/pitrou'
Some properties on IPv4Address and IPv6Address instantiate one or several network objects each time they are computed. Instead these characteristic networks can be computed once and for all at module import. Patch attached.
(note: the lru_cache() decorator seems to mitigate this in micro-benchmarks, but the common pattern is not to call .is_private on always the same address :-))
New changeset 7a28ab8f012f by Antoine Pitrou in branch 'default':
Issue bpo-21513: Speedup some properties of IP addresses (IPv4Address, IPv6Address) such as .is_private or .is_multicast. http://hg.python.org/cpython/rev/7a28ab8f012f
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: