[issue32204] async/await performance is very low

2017-12-20 Thread Yury Selivanov
Yury Selivanov added the comment: Unfortunately they will not be backported, that's against our release policies, and I can't do anything about it. You can backport them yourself and build your own CPython 3.6. That's what bigger users (e.g. Facebook/Google) of Python usually do. -

[issue32204] async/await performance is very low

2017-12-19 Thread Liran Nuna
Liran Nuna added the comment: Yuri, Those speed improvements are awesome and I'm really excited about them, performance is slowly starting to match asynq and would make us migrating our code to async/await more feasable! Today, python3.6.4 was released and these performance improvements did n

[issue32204] async/await performance is very low

2017-12-17 Thread Yury Selivanov
Yury Selivanov added the comment: NP. I have another PR in the pipeline: https://github.com/python/cpython/pull/4913 Both optimizations make your benchmark run 30% faster on 3.7. If you compile asyncio.gather() with Cython you will get it another 5-15% faster. If you use uvloop - another

[issue32204] async/await performance is very low

2017-12-17 Thread Liran Nuna
Liran Nuna added the comment: Yury, thank you very much for circling back. I wish I could be more helpful in pursuing performance improvements. -- ___ Python tracker ___ _

[issue32204] async/await performance is very low

2017-12-17 Thread Yury Selivanov
Yury Selivanov added the comment: Liran, Task (C implementation) was optimized in issue 32348; your benchmark now runs 15% faster. -- ___ Python tracker ___ _

[issue32204] async/await performance is very low

2017-12-04 Thread Liran Nuna
Liran Nuna added the comment: > Also I suggest you to try uvloop Sadly, uvloop does not offer any noticeable improvement in performance for us. Our usage is very similar to the "benchmarks" I posted - we don't do any actual async I/O because asynq does not offer that. > I suggest you to pro

[issue32204] async/await performance is very low

2017-12-04 Thread Yury Selivanov
Yury Selivanov added the comment: Also I suggest you to try uvloop. If your production code is still slower that with asynq, I suggest you to profile it and post real profiles here. I just don't think that asyncio.gather can be the main bottleneck you have, it must be something else. -

[issue32204] async/await performance is very low

2017-12-04 Thread Yury Selivanov
Yury Selivanov added the comment: > I agree that the PR I offers little (or no) improvement but I implore you to > explore performance bottlenecks in async/await. And I'm saying that there are no "performance bottlenecks in async/await". async/await is *not* asyncio. async/await and yield a

[issue32204] async/await performance is very low

2017-12-04 Thread Liran Nuna
Liran Nuna added the comment: > which makes them faster in some specific micro-benchmarks I'm not talking about micro-benchmarks, we are actively using asynq in production. Recent efforts to migrate to async/await have hit a major performance hit - our response times nearly doubled. I agree

[issue32204] async/await performance is very low

2017-12-03 Thread Yury Selivanov
Yury Selivanov added the comment: In general, implementing coroutines using 'yield' expressions (not 'yield from'!) is slower than async/await, because the former approach needs a trampoline to manage the stack, whereas CPython itself handles that for 'yield from' and 'await'. I suspect that

[issue32204] async/await performance is very low

2017-12-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: ~3-5% difference is a random variance. Add 1/0 in this method and repeat the benchmark. -- ___ Python tracker ___ _

[issue32204] async/await performance is very low

2017-12-03 Thread Liran Nuna
Liran Nuna added the comment: The PR is merely a finding I ran into while benchmarking. In my executions I saw a consistent ~3-5% performance increase. At my company we are attempting to migrate from asynq to asyncio but performance suffers (our servers response times nearly double). I person

[issue32204] async/await performance is very low

2017-12-03 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.7 -Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue32204] async/await performance is very low

2017-12-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't see any difference after applying PR 4186. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue32204] async/await performance is very low

2017-12-03 Thread Liran Nuna
Liran Nuna added the comment: Added comparable benchmark in asynq -- Added file: https://bugs.python.org/file47314/batch_asynq.py ___ Python tracker ___ ___

[issue32204] async/await performance is very low

2017-12-03 Thread Liran Nuna
New submission from Liran Nuna : The performance of async/await is very low when compared to similar code that implements similar functionality via iterators, such as Quora's asynq library (https://github.com/quora/asynq/tree/master/asynq). Based on my benchmarks, asynq is almost twice as fast