-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Possible regression in GC time in 1.10 #53018
Comments
I think this might be fixed by #52994. Edit. this is unlikely to have fixed it since this is single threaded. |
Another quick comment: |
The difference is that we run way too many full collections here, both in 1.10 and master. Specially in 1.10 |
This should very roughly resemble the workflow in Groebner.jl: # Very important work
function work0(m, n, k)
for _ in 1:k
polys = [rand(UInt32, rand(1:m)) for _ in 1:n]
work1(polys)
end
end
function work1(polys)
res = 0
for poly in polys
new_poly = work2(poly)
res += sum(new_poly)
end
res
end
function work2(poly)
new_poly = similar(poly)
work3!(new_poly)
end
function work3!(poly::AbstractVector{T}) where {T}
poly[1] = one(T)
for i in 2:length(poly)
poly[i] = convert(T, i)^3 - poly[i - 1]
end
poly
end
using InteractiveUtils; versioninfo()
@time work0(100, 100_000, 10)
@time work0(100, 100_000, 10)
@time work0(100, 100_000, 10)
@time work0(100, 100_000, 10)
@time work0(100, 100_000, 10) Resulting in 1.9: Julia Version 1.9.2
Commit e4ee485e909 (2023-07-05 09:39 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 64 × Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, skylake-avx512)
Threads: 1 on 64 virtual cores
Environment:
LD_LIBRARY_PATH = :/home/demin/libs2/usr/local/lib/
2.161450 seconds (2.00 M allocations: 519.583 MiB, 34.35% gc time)
1.992795 seconds (2.00 M allocations: 519.507 MiB, 32.74% gc time)
1.951021 seconds (2.00 M allocations: 519.505 MiB, 32.37% gc time)
1.949284 seconds (2.00 M allocations: 519.529 MiB, 32.36% gc time)
1.855381 seconds (2.00 M allocations: 519.498 MiB, 30.36% gc time) 1.10: Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 64 × Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, skylake-avx512)
Threads: 1 on 64 virtual cores
Environment:
LD_LIBRARY_PATH = :/home/demin/libs2/usr/local/lib/
4.185146 seconds (2.00 M allocations: 519.578 MiB, 53.11% gc time)
4.822002 seconds (2.00 M allocations: 519.339 MiB, 60.95% gc time)
4.269982 seconds (2.00 M allocations: 520.013 MiB, 57.77% gc time)
4.377889 seconds (2.00 M allocations: 519.624 MiB, 57.68% gc time)
4.543688 seconds (2.00 M allocations: 519.801 MiB, 57.88% gc time) |
for a more minimal mwe,
|
Didn't investigate The difference between 1.9 and 1.10 seems to be mostly on the number of full collections we're running (0 on 1.9, 3 on 1.10). The regression is certainly still there, but it's not really surprising given that we returned to more aggressive GC heuristics in 1.10. Also, note that we seem to be able to recover some of the performance in this MWE by using GC threads, at least on the M2. MWE: function work0(m, n, k)
res=0.0
for _ in 1:k
res += sum(sum.([rand(rand(1:m)) for _ in 1:n]))
end
res
end
GC.enable_logging()
@time work0(100, 100_000, 10)
|
Right, I also observe this |
Do we know what commit changed this? Maybe a bisect is warranted? I think this is a pretty unacceptable regression. |
From 1.9.4 to 1.10.0, according to my bisect, 3b97715 is the first commit with this regression. The output for 3b97715: Julia Version 1.10.0-beta3.24
Commit 3b9771507a (2023-10-20 20:43 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 64 × Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, skylake-avx512)
Threads: 1 on 64 virtual cores
Environment:
LD_LIBRARY_PATH = :/home/demin/libs2/usr/local/lib/
3.512954 seconds (2.00 M allocations: 519.278 MiB, 54.29% gc time)
3.799685 seconds (2.00 M allocations: 520.242 MiB, 61.02% gc time)
3.384975 seconds (2.00 M allocations: 519.617 MiB, 58.15% gc time)
3.464177 seconds (2.00 M allocations: 519.612 MiB, 59.38% gc time)
3.584769 seconds (2.00 M allocations: 519.452 MiB, 60.04% gc time) The output for the previous commit: Julia Version 1.10.0-beta3.23
Commit d4809e5b77* (2023-10-20 09:45 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 64 × Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, skylake-avx512)
Threads: 1 on 64 virtual cores
Environment:
LD_LIBRARY_PATH = :/home/demin/libs2/usr/local/lib/
2.720464 seconds (2.00 M allocations: 519.775 MiB, 41.72% gc time)
1.947959 seconds (2.00 M allocations: 519.718 MiB, 26.96% gc time)
1.850764 seconds (2.00 M allocations: 519.615 MiB, 19.69% gc time)
1.943128 seconds (2.00 M allocations: 519.803 MiB, 25.03% gc time)
2.401440 seconds (2.00 M allocations: 519.135 MiB, 43.55% gc time) |
that was what I thought it would be, but @JeffBezanson and I tried 1.8 and it was fast also, so I'm confused |
This is an unfortunate slowdown but since it is not new in 1.11 it probably doesn't make sense to hold the 1.11 release for this. |
Hi, is there progress with this? There is more code in the ecosystem that is affected by the slowdown, as I would imagine. The reproducing example is a fairly common thing to write. |
Hi!
Out of curiousity, I checked the performance of my package (Groebner) on recent 1.11.
It occurred to me that there could be a regression, and that the root of it could be somewhere in 1.10.
My back of the envelope benchmarks show a 2-5x slowdown in 1.10 compared to 1.9, see below.
I run the script
And get the output:
1.9.2 (official release):
1.10.0 (official release):
1.11 (1 day old master):
One feature of the
Groebner.groebner
function is that it allocates a lot of small vectors throughout execution.I can try to isolate this into a smaller example if it would make sense.
All julia versions use AbstractAlgebra v0.35.3 and Groebner v0.6.3.
I run julia without cli arguments and without a startup file.
My machine is:
The text was updated successfully, but these errors were encountered: