-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
bisect wantedperformanceMust go fasterMust go fasterregression 1.12Regression in the 1.12 releaseRegression in the 1.12 release
Description
@benchmark
on the program below reports x5 slower (800ns vs 160ns) with Julia 1.12.1 wrt 1.11.6. Same timing if we setup tmp argument through benchmark setup argument. Tested on Ubuntu 25.04.
However, the manual @time
reports the same timing in both versions.
The difference only occurs with Float32 (not with Float64, Int32 for Int64)
using BenchmarkTools
function f(tmp::Tuple{Float32, Float32})::Float32
i = 1
while i <= 1000
if i % 2 == 0
tmp = (tmp[1], tmp[2] + one(Float32))
end
i += 1
end
return tmp[1] + tmp[2]
end
function main()
tmp = (zero(Float32), zero(Float32))
res = 0
@time for i in 1:10_000
tmp = (zero(Float32), zero(Float32))
res += f(tmp)
end
println(res)
return display(@benchmark($f($tmp)))
end
main()
Julia 1.12.1

Julia 1.11.6

Metadata
Metadata
Assignees
Labels
bisect wantedperformanceMust go fasterMust go fasterregression 1.12Regression in the 1.12 releaseRegression in the 1.12 release