-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use custom iterators for replace(), skip() and fail()
This dramatically improves the performance of skip() on arrays by getting rid of the type instability which is currently not well handled. This optimization cannot be applied to non-array iterables since it relies on passing indices and accessing an entry several times in some cases. Hovewer, forcing inlining makes the code somewhat faster even for non-arrays. Performance improvements are smaller but still significant for replace() and skip(). There is 2× regression when passing a generator to fail(), though, but the gain for the array case is worth it. The second advantage of using custom iterators is that eltype() returns Nulls.T(eltype(x)) when x is an array, while when using plain generators it returned Any.
- Loading branch information
Showing
2 changed files
with
226 additions
and
6 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