New submission from Antoine 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 :-)) ---------- components: Library (Lib) files: ipaddr_props.patch keywords: patch messages: 218630 nosy: ncoghlan, pitrou, pmoody, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: speed up some ipaddress properties type: performance versions: Python 3.5 Added file: http://bugs.python.org/file35260/ipaddr_props.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21513> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com