mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Motivation: We allocated a new ContiguousArray per each EventLoop run when tasks needed to be executed. We can just re-use the same instance all the time and so safe malloc operations (we will need to do memset tho). Beside this we also did not reserve the needed capacity up fron which could lead to realloc operations. Modifications: - Reuse same ContiguousArray instance - Correctly set the initial capacity Result: Less overhead when processing tasks via the EventLoop