Author pitrou
Recipients ncoghlan, pitrou, pmoody
Date 2014-05-12.18:57:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1399921054.49.0.986527844973.issue21486@psf.upfronthosting.co.za>
In-reply-to
Content
Updated patch, also optimizing v6 netmask parsing (same principle).

Before patch:

$ ./python -m timeit -s "import ipaddress" "net = ipaddress.IPv6Network(('2001:db8::', 96))"
10000 loops, best of 3: 26.1 usec per loop

$ ./python -m timeit -s "import ipaddress" "net = ipaddress.IPv4Network(('10.0.0.0', 23))"
100000 loops, best of 3: 17 usec per loop

After patch:

$ ./python -m timeit -s "import ipaddress" "net = ipaddress.IPv6Network(('2001:db8::', 96))"
100000 loops, best of 3: 13.8 usec per loop

$ ./python -m timeit -s "import ipaddress" "net = ipaddress.IPv4Network(('10.0.0.0', 23))"
100000 loops, best of 3: 14.3 usec per loop
History
Date User Action Args
2014-05-12 18:57:34pitrousetrecipients: + pitrou, ncoghlan, pmoody
2014-05-12 18:57:34pitrousetmessageid: <1399921054.49.0.986527844973.issue21486@psf.upfronthosting.co.za>
2014-05-12 18:57:34pitroulinkissue21486 messages
2014-05-12 18:57:33pitroucreate