Repository navigation
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Documentation build overview
113 files changed ·
|
2950322 to
917f47b
Compare
|
Sorry, but I don't see in any tests, assertion on the |
|
Right, no test asserts the value of |
|
That sounds good to me. |
…e polling for I/O Run callbacks that are scheduled during an event loop iteration eagerly, within the limits of the new asyncio.EventLoopSettings, instead of always waiting for the next I/O poll. asyncio.sleep(0) and loop.stop() end eager processing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run callbacks that are scheduled during an event loop iteration eagerly, within a small budget, instead of always waiting for the next I/O poll. This removes one
select()/epoll_wait()call per hop in code that resolves futures or wakes tasks in chains.asyncio.EventLoopSettings(eager_max_time, eager_max_callbacks)andloop.get_settings()/loop.set_settings(). The defaults are 100 µs and 100 callbacks;eager_max_time=0turns eager processing off.asyncio.sleep(0), which still guarantees an I/O poll, and onloop.stop(), which keeps its documented "current batch only" behaviour.Benchmarks (release build, script): a
call_soon()chain is 38% faster,Queueping-pong 25% faster, and a task awaiting a child task 33% faster. Servers with many connections are unchanged. While a long run of callbacks keeps going, timers and I/O can be delayed by up to about 100–200 µs.A few tests that assumed "one task hop = one I/O poll" were adjusted.