-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Open
Labels
fixed on masterfoldsum, maximum, reduce, foldl, etc.sum, maximum, reduce, foldl, etc.performanceMust go fasterMust go fasterregression 1.12Regression in the 1.12 releaseRegression in the 1.12 release
Description
I'm observing a 2.5x slowdown when summing over an iterator. The code
using Chairmarks
struct A end
struct B end
struct C end
struct D end
struct E end
struct F end
const U = Union{A, B, C, D, E, F}
f(a::A) = 1
f(b::B) = 2
f(c::C) = 3
f(d::D) = 4
f(e::E) = 5
f(f::F) = 6
v = U[rand((A(), B(), C(), D(), E(), F())) for _ in 1:1000];
gives
julia> @b sum(f, $v), sum(f, x for x in $v)
(431.909 ns, 1.771 μs) # 1.11.5
(441.500 ns, 4.083 μs) # 1.12.0-beta2
Julia Version 1.12.0-beta2
Commit dd74040f22b (2025-04-25 12:03 UTC)
Build Info:
Official https://julialang.org release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 4 × Intel(R) Core(TM) i3-10110U CPU @ 2.10GHz
WORD_SIZE: 64
LLVM: libLLVM-18.1.7 (ORCJIT, skylake)
GC: Built with stock GC
Threads: 1 default, 1 interactive, 1 GC (on 4 virtual cores)
Metadata
Metadata
Assignees
Labels
fixed on masterfoldsum, maximum, reduce, foldl, etc.sum, maximum, reduce, foldl, etc.performanceMust go fasterMust go fasterregression 1.12Regression in the 1.12 releaseRegression in the 1.12 release