mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Motivation: The schedule callback mechanism on `EventLoop` has an equivalent on an isolated `EventLoop`. The default isolated implementation puts the hander in a loop bound box and calls the non-isolated version. This is okay but introduces a number of additional "in event loop" checks which are required for correctness in the general case (i.e. not called from an isolated event loop). Modifications: - Implement the customisation point directly to avoid the additional checks (the are unecessary by definition of being on the isolated event loop). - Add benchmarks Result: On the isolated event loop, in micro benchmarks: - scheduleTask is ~1.6x faster - scheduleCallback is ~2x faster