-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ProgressMeter Deprecation Warning and nothing comparison #536
Conversation
Just out of curiosity, what is the advantage of |
I thought there was a reference in the performance section of the Julia documentation, but I can't seem to find it. I have run into an issue once where
The Julia implementation of julia> x = [1, 3, 4];
julia> @benchmark x == nothing
BenchmarkTools.Trial: 10000 samples with 1000 evaluations.
Range (min … max): 3.041 ns … 12.125 ns ┊ GC (min … max): 0.00% … 0.00%
Time (median): 3.125 ns ┊ GC (median): 0.00%
Time (mean ± σ): 3.126 ns ± 0.214 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
▆ █ ▃ ▂ ▁
█▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁█ █
3.04 ns Histogram: log(frequency) by time 3.25 ns <
Memory estimate: 0 bytes, allocs estimate: 0.
julia> @benchmark x === nothing
BenchmarkTools.Trial: 10000 samples with 1000 evaluations.
Range (min … max): 1.500 ns … 6.292 ns ┊ GC (min … max): 0.00% … 0.00%
Time (median): 1.583 ns ┊ GC (median): 0.00%
Time (mean ± σ): 1.569 ns ± 0.059 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
▁ ▆▇ █ ▃ ▁
█▁▁▁▁▁▁▁▁▁▁▁▁██▁▁▁▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▁▁▁█ █
1.5 ns Histogram: log(frequency) by time 1.67 ns <
Memory estimate: 0 bytes, allocs estimate: 0.
julia> @benchmark isnothing(x)
BenchmarkTools.Trial: 10000 samples with 1000 evaluations.
Range (min … max): 1.458 ns … 16.417 ns ┊ GC (min … max): 0.00% … 0.00%
Time (median): 1.583 ns ┊ GC (median): 0.00%
Time (mean ± σ): 1.579 ns ± 0.172 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
▁ █ █▇ ▅ ▂ ▂ ▂
▃▁▁▁▁▁▁▁█▁▁▁▁▁▁▁█▁▁▁▁▁▁▁██▁▁▁▁▁▁▁█▁▁▁▁▁▁▁█▁▁▁▁▁▁▁█▁▁▁▁▁▁▁█ █
1.46 ns Histogram: log(frequency) by time 1.75 ns <
Memory estimate: 0 bytes, allocs estimate: 0. |
wow, thanks for the thorough explanation! But actually, why aren't we using |
I changed the code to use |
Progress
in line with the deprecation warningnothing
to use===
vs==
Closes #533