{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/27781","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/27781/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/27781/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/27781/events","html_url":"https://github.com/JuliaLang/julia/issues/27781","id":335576532,"node_id":"MDU6SXNzdWUzMzU1NzY1MzI=","number":27781,"title":"`sort!(::Vector{Union{Float64, Missing}})` allocates unexpectedly in v0.7-beta","user":{"login":"rdeits","id":591886,"node_id":"MDQ6VXNlcjU5MTg4Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/591886?v=4","gravatar_id":"","url":"https://api.github.com/users/rdeits","html_url":"https://github.com/rdeits","followers_url":"https://api.github.com/users/rdeits/followers","following_url":"https://api.github.com/users/rdeits/following{/other_user}","gists_url":"https://api.github.com/users/rdeits/gists{/gist_id}","starred_url":"https://api.github.com/users/rdeits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdeits/subscriptions","organizations_url":"https://api.github.com/users/rdeits/orgs","repos_url":"https://api.github.com/users/rdeits/repos","events_url":"https://api.github.com/users/rdeits/events{/privacy}","received_events_url":"https://api.github.com/users/rdeits/received_events","type":"User","site_admin":false},"labels":[{"id":437820724,"node_id":"MDU6TGFiZWw0Mzc4MjA3MjQ=","url":"https://api.github.com/repos/JuliaLang/julia/labels/missing%20data","name":"missing data","color":"d4c5f9","default":false},{"id":115858,"node_id":"MDU6TGFiZWwxMTU4NTg=","url":"https://api.github.com/repos/JuliaLang/julia/labels/performance","name":"performance","color":"d7e102","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2018-06-25T21:34:38Z","updated_at":"2018-06-28T20:04:55Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Opening an issue as suggested here: https://discourse.julialang.org/t/with-missings-julia-is-slower-than-r/11838/17?u=rdeits\r\n\r\nSorting a Float64 array in-place is quite fast and non-allocating: \r\n\r\n```julia\r\njulia> @btime sort!(y) setup=(y = rand(100)) evals=1\r\n  2.414 μs (0 allocations: 0 bytes)\r\n```\r\n\r\nbut sorting an array of `Union{Float64, Missing}` in-place allocates a new copy and is about 2x slower, regardless of the input size:  \r\n\r\n```julia\r\njulia> @btime sort!(y2) setup=(y = rand(100); y2 = ifelse.(rand(length(y)) .< 0.9, y, missing)) evals=1\r\n  4.157 μs (2 allocations: 624 bytes)\r\n```\r\n\r\n```julia\r\njulia> versioninfo()\r\nJulia Version 0.7.0-beta.5\r\nCommit 948b088f17 (2018-06-24 17:50 UTC)\r\nPlatform Info:\r\n  OS: Linux (x86_64-pc-linux-gnu)\r\n  CPU: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz\r\n  WORD_SIZE: 64\r\n  LIBM: libopenlibm\r\n  LLVM: libLLVM-6.0.0 (ORCJIT, skylake)\r\n```"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/401156494","html_url":"https://github.com/JuliaLang/julia/issues/27781#issuecomment-401156494","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/27781","id":401156494,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTE1NjQ5NA==","user":{"login":"haampie","id":194764,"node_id":"MDQ6VXNlcjE5NDc2NA==","avatar_url":"https://avatars3.githubusercontent.com/u/194764?v=4","gravatar_id":"","url":"https://api.github.com/users/haampie","html_url":"https://github.com/haampie","followers_url":"https://api.github.com/users/haampie/followers","following_url":"https://api.github.com/users/haampie/following{/other_user}","gists_url":"https://api.github.com/users/haampie/gists{/gist_id}","starred_url":"https://api.github.com/users/haampie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haampie/subscriptions","organizations_url":"https://api.github.com/users/haampie/orgs","repos_url":"https://api.github.com/users/haampie/repos","events_url":"https://api.github.com/users/haampie/events{/privacy}","received_events_url":"https://api.github.com/users/haampie/received_events","type":"User","site_admin":false},"created_at":"2018-06-28T20:04:55Z","updated_at":"2018-06-28T20:04:55Z","author_association":"CONTRIBUTOR","body":"My guess is that the above might not be noticeably slower than #27817, maybe even faster?"}}
{"actor":{"display_login":"haampie"}}