Martin v. Löwis added the comment:

Please understand that Victor and I were asking you to pass a *unicode* object, 
with a *u* prefix. For me, the time more-than-doubles, on OSX, with the system 
python.

mvl:~ loewis$ /usr/bin/python -m timeit -s "import socket; s = 
socket.socket(socket.AF_INET, socket.SOCK_DGRAM)" "s.sendto(b'hello', 
('127.0.0.1', 4242))"
100000 loops, best of 3: 8.15 usec per loop
mvl:~ loewis$ /usr/bin/python -m timeit -s "import socket; s = 
socket.socket(socket.AF_INET, socket.SOCK_DGRAM)" "s.sendto(b'hello', 
(u'127.0.0.1', 4242))"
10000 loops, best of 3: 19.5 usec per loop
mvl:~ loewis$ /usr/bin/python -V
Python 2.7.5

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22127>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to