-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Labels
missing dataBase.missing and related functionalityBase.missing and related functionalityperformanceMust go fasterMust go fastersortingPut things in orderPut things in order
Description
Opening an issue as suggested here: https://discourse.julialang.org/t/with-missings-julia-is-slower-than-r/11838/17?u=rdeits
Sorting a Float64 array in-place is quite fast and non-allocating:
julia> @btime sort!(y) setup=(y = rand(100)) evals=1
2.414 μs (0 allocations: 0 bytes)but sorting an array of Union{Float64, Missing} in-place allocates a new copy and is about 2x slower, regardless of the input size:
julia> @btime sort!(y2) setup=(y = rand(100); y2 = ifelse.(rand(length(y)) .< 0.9, y, missing)) evals=1
4.157 μs (2 allocations: 624 bytes)julia> versioninfo()
Julia Version 0.7.0-beta.5
Commit 948b088f17 (2018-06-24 17:50 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, skylake)Datseris and ChrisRackauckas
Metadata
Metadata
Assignees
Labels
missing dataBase.missing and related functionalityBase.missing and related functionalityperformanceMust go fasterMust go fastersortingPut things in orderPut things in order