Skip to content

Optimize descriptor registration in event loop #53

@EdmondDantes

Description

@EdmondDantes

Refactor the event loop to register descriptors only once during their lifetime.
Instead of repeatedly adding and removing descriptors on each await operation, a descriptor will remain registered in the loop until it is closed.

This approach minimizes the number of syscalls (epoll_ctl ADD/DEL) by relying on a one-time registration and deferred removal.
It reduces overhead in high-concurrency scenarios and aligns the implementation with common practices in event loop libraries (e.g., libuv, Swoole).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions