Message296536
> But how large is the performance hit of this change? It adds at least one additional memory allocation for the str object. If the slowdown is significant perhaps it is worth to keep the old code as a fast path.
commit 5cc7ac24da10568d2a910a91a24183b904118cf8
./python -m timeit -s 'import socket' 'socket.getaddrinfo(None, 1000)'
2000 loops, best of 5: 139 usec per loop
./python -m timeit -s 'import socket' 'socket.getaddrinfo(None, "1000")'
2000 loops, best of 5: 142 usec per loop
with getaddrinfo_overflow_error.patch
./python -m timeit -s 'import socket' 'socket.getaddrinfo(None, 1000)'
2000 loops, best of 5: 140 usec per loop
./python -m timeit -s 'import socket' 'socket.getaddrinfo(None, "1000")'
2000 loops, best of 5: 139 usec per loop
It seems the impact on performance is negligible/not measurable. |
|
Date |
User |
Action |
Args |
2017-06-21 10:08:41 | smejkar | set | recipients:
+ smejkar, benjamin.peterson, serhiy.storchaka |
2017-06-21 10:08:41 | smejkar | set | messageid: <1498039721.21.0.654334327188.issue30710@psf.upfronthosting.co.za> |
2017-06-21 10:08:41 | smejkar | link | issue30710 messages |
2017-06-21 10:08:40 | smejkar | create | |
|