-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make map() and broadcast() faster for Union{T, Missing/Nothing} eltyp…
…es (#25828) Storing typeof(el)/eltype(B) in a variable in the hot part of the loop kills performance because despite being inferred as equal to Union{Type{T}, Type{Missing/Nothing}}, it is marked as ::Any. Only using typeof()/eltype() when isa() fails works around the problem and makes map/broadcast(x->x, ::Vector{Union{Int, Missing}}) about 10 times faster.
- Loading branch information
1 parent
8076a1b
commit 2d39767
Showing
2 changed files
with
4 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