-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use NIO scheduleCallback API for connection handler timers (#28)
## Motivation NIO 2.75.0 added new APIs for scheduling callbacks, which can be used to implement timers with fewer allocations than the previous APIs[^0]. ## Modifications Replace the timers used in the client and server connection handlers with a new implementation that uses these new NIO APIs. ## Result This should have no functional impact. However it reduces the allocations in the connection handler. How many allocations it reduces will depend on the exact scenario, but running the `echo` server under Instruments and sending 1000 requests suggests around 10%. [^0]: https://github.com/apple/swift-nio/releases/tag/2.75.0 --------- Co-authored-by: George Barnett <[email protected]>
- Loading branch information
1 parent
8700758
commit 565aae3
Showing
5 changed files
with
310 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.