Message210478
FWIW, according to your comments I tried a quick and dirty fix in my code as I can't wait for a new Python release to make it work:
The do_stuff function now does:
"""
def do_stuff():
client=make_client('',6666, b"foo")
data_proxy=client.get_proxy()
#make a dummy request to get the underlying
#fd we are reading from (see bug #20540)
c=data_proxy.good([1,2],[3,4])
fd=data_proxy._tls.connection._handle
#setting TCP_NODELAY on 3.3.x should fix the delay issue until a new release
sock=socket.fromfd(fd, socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
for i in range(10):
t_s=time.time()
c=data_proxy.good([1,2],[3,4])
print(time.time()-t_s)
print(c)
"""
I'm now down to 0.04s per request instead of ~0.08s, I guess the remaining delay comes from the server side socket which has not been affected by the TCP_NODELAY on the client side.
Regards. |
|
Date |
User |
Action |
Args |
2014-02-07 14:53:52 | Irvin.Probst | set | recipients:
+ Irvin.Probst, pitrou, vstinner, neologix, sbt |
2014-02-07 14:53:52 | Irvin.Probst | set | messageid: <1391784832.03.0.100782981292.issue20540@psf.upfronthosting.co.za> |
2014-02-07 14:53:52 | Irvin.Probst | link | issue20540 messages |
2014-02-07 14:53:51 | Irvin.Probst | create | |
|