Skip to content
This repository was archived by the owner on Jun 5, 2026. It is now read-only.

[pyproto] async perf improvement - #311

Merged
yunhaoling merged 3 commits into
Azure:pyprotofrom
yunhaoling:yuling/pyproto/async-perf-improvement
Mar 4, 2022
Merged

[pyproto] async perf improvement#311
yunhaoling merged 3 commits into
Azure:pyprotofrom
yunhaoling:yuling/pyproto/async-perf-improvement

Conversation

@yunhaoling

@yunhaoling yunhaoling commented Feb 18, 2022

Copy link
Copy Markdown
Contributor

addressing issue: Azure/azure-sdk-for-python#21142

  • drop asyncio.wait_for in transport
  • drop gather in connection listen to prevent creation of excessive amount of coroutine tasks

Comment thread uamqp/aio/_connection_async.py Outdated
@yunhaoling
yunhaoling requested a review from annatisch March 4, 2022 00:25
for task in tasks:
task.cancel()
for _ in range(batch):
if await asyncio.ensure_future(self._listen_one_frame(**kwargs)):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the benefit in using ensure_future if we're going to directly await the coroutine?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in my experiment, ensure_future actually gives better performance than await..
let me add a todo to further test the diff here.

@yunhaoling
yunhaoling merged commit de6e639 into Azure:pyproto Mar 4, 2022
@yunhaoling
yunhaoling deleted the yuling/pyproto/async-perf-improvement branch March 4, 2022 08:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants