You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> using BenchmarkTools; using Random: default_rng
julia> function sim!(a, N)
n = length(a)
rng = default_rng()
@inbounds for iter in 1:N
i = rand(rng, 1:n)
j = rand(rng, 1:n-1)
j = ifelse(j == i, n, j)
Δ = 0.05 * a[i]
a[i] -= Δ
a[j] += Δ
end
end
sim! (generic function with 1 method)
This came up in the julia slack channel, via https://twitter.com/genkuroki/status/1293558651588767750. Disregarding the type instability from their benchmark, there seems to be a true regression
Julia 1.4.1:
Julia 1.5.0:
around 10% difference.
Finally, it does seem like
rand
is actually faster on Julia 1.5.0:so it's a bit confusing why
sim!
is slower on Julia 1.5.0.The text was updated successfully, but these errors were encountered: