Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ThreadPool cleanup (3/n): Switch to vectorized API & remove unused/co… (
#32) * ThreadPool cleanup (3/n): Switch to vectorized API & remove unused/confusing extensions and implementations. This change takes a first^H^H^H^H^H^Hthird whack at a bunch of tech debt: 1. Removes the Naive thread pool implementation from `PJoin`. 2. Removes the unnecessary `TypedComputeThreadPool` protocol refinement. 3. Removes the badly implemented extensions that implemented `parallelFor` in terms of `join`. (Note: `NonBlockingThreadPool`'s `parallelFor` is re-implemented in terms of `join` again, but better.) 4. Removes use of `rethrows`, as the rethrows language feature is not expressive enough to allow the performance optimizations for the non-throwing case. Instead, methods are explicitly overloaded with throwing and non-throwing variants. 5. Adds a vectorized API (which improves performance). Performance measurements: After: name time std iterations -------------------------------------------------------------------------------------------------------------------- NonBlockingThreadPool: join, one level 700.0 ns ± 70289.84998218225 127457 NonBlockingThreadPool: join, two levels 2107.0 ns ± 131041.5070696377 31115 NonBlockingThreadPool: join, three levels 4960.0 ns ± 178122.9562964306 15849 NonBlockingThreadPool: join, four levels, three on thread pool thread 5893.0 ns ± 224021.47900401088 13763 NonBlockingThreadPool: parallel for, one level 22420.0 ns ± 203689.69689780468 7581 NonBlockingThreadPool: parallel for, two levels 500985.5 ns ± 642136.0139757036 1390 Before: name time std iterations --------------------------------------------------------------------------------------------------------------------- NonBlockingThreadPool: join, one level 728.0 ns ± 78662.43173968921 115554 NonBlockingThreadPool: join, two levels 2149.0 ns ± 144611.11773139169 30425 NonBlockingThreadPool: join, three levels 5049.0 ns ± 188450.6773907647 15157 NonBlockingThreadPool: join, four levels, three on thread pool thread 5951.0 ns ± 229270.51587738466 10255 NonBlockingThreadPool: parallel for, one level 4919427.5 ns ± 887590.5386061076 302 NonBlockingThreadPool: parallel for, two levels 4327151.0 ns ± 855302.611386676 313 Co-authored-by: Dave Abrahams <dabrahams@google.com>
- Loading branch information
Showing
9 changed files
with
163 additions
and
553 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
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.