-
Notifications
You must be signed in to change notification settings - Fork 656
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Motivation: Our original Heap implementation used a bunch of static functions in order to make it clear how it related to textbook heap implementations. This was primarily done to ensure that it was easier to see the correctness of the code. However, we've long been satisfied with the correctness of the code, and the Heap is one of the best tested parts of NIO. For this reason, we should be free to refactor it. Given https://bugs.swift.org/browse/SR-10346, we've been given an incentive to do that refactor right now. This is because the Heap is causing repeated CoW operations each time we enqueue new work onto the event loop. That's a substantial performance cost: well worth fixing with a small rewrite. Modifications: - Removed all static funcs from Heap - Rewrote some into instance funcs - Merged the implementation of insert into append. Result: Faster Heap, happier users, sadder textbook authors.
- Loading branch information
Showing
4 changed files
with
54 additions
and
49 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
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