Closed arthurdarcet closed 8 years ago
Can you use cProfile around the run_until_complete()
so we can get more details?
does that work ? http://arthur.darcet.fr/a.cprof
https://github.com/python/asyncio/blob/master/asyncio/unix_events.py#L523
data = b''.join(self._buffer)
assert data, 'Data should not be empty'
self._buffer.clear()
...
elif n > 0:
data = data[n:]
self._buffer.append(data) # Try again later.
buffer implementation of UnixWritePipeTransport is not good at large data. macOS has very little pipe buffer compared to linux. It cause more performance penalty.
Using bytearray as FIFO buffer will fix it. But #339 will fix it too.
thanks, the PR works: this is what i get with #339 on OSX:
1e+05 0.0004410743713378906
2e+05 0.0007159709930419922
3e+05 0.0011639595031738281
1e+06 0.003136873245239258
2e+06 0.005909919738769531
3e+06 0.009123086929321289
1e+07 0.03362894058227539
2e+07 0.06357192993164062
3e+07 0.09158802032470703
1e+08 0.27935194969177246
2e+08 0.6114847660064697
3e+08 0.8901691436767578
1e+09 2.8768999576568604
I'm on Python 3.5.2, with the following code:
on an Ubuntu server (this seems ok)
on an Archlinux: (more or less ok)
on osx: (not ok)
Any idea what could be causing this?