Skip to content
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

Unusually long GC times in 1.10 and master #50956

Open
gitboy16 opened this issue Aug 17, 2023 · 2 comments
Open

Unusually long GC times in 1.10 and master #50956

gitboy16 opened this issue Aug 17, 2023 · 2 comments
Labels
GC Garbage collector performance Must go faster

Comments

@gitboy16
Copy link
Contributor

Hi,

Sorry for the bad subject name but I am struggling to understand what is going on in the below code.
I noticed that vector allocation sometimes take an unusual amount of time to run. Please note the ~100ms for Julia 1.11 below. This can also be seen in 1.10.
Note I am on windows.

Regards

import Random, Dates

Random.seed!(1234)
xp = rand(10^8)

function foofoo(xp::AbstractVector{T}, len = length(xp)) where {T}
    t = Vector{Dates.DateTime}(undef, 2)
    t[1] = Dates.now()    
    vans = Vector{T}(undef, len)
    t[2] = Dates.now()
    println("Time: $(t[2]-t[1])")
    vans
end

for _ in 1:10
    foofoo(xp);
end

JULIA 1.9.2

julia> include("Untitled.jl")
Time: 1 millisecond
Time: 1 millisecond
Time: 0 milliseconds
Time: 1 millisecond
Time: 0 milliseconds
Time: 0 milliseconds
Time: 1 millisecond
Time: 0 milliseconds
Time: 0 milliseconds
Time: 1 millisecond

julia> include("Untitled.jl")
Time: 1 millisecond
Time: 1 millisecond
Time: 1 millisecond
Time: 0 milliseconds
Time: 1 millisecond
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds

julia> include("Untitled.jl")
Time: 1 millisecond
Time: 1 millisecond
Time: 1 millisecond
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 1 millisecond

julia> versioninfo()
Julia Version 1.9.2
Commit e4ee485e90 (2023-07-05 09:39 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Xeon(R) Gold 6254 CPU @ 3.10GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake-avx512)
  Threads: 1 on 8 virtual cores

JULIA 1.11.0-DEV

julia> include("Untitled.jl")
Time: 0 milliseconds
Time: 13 milliseconds
Time: 106 milliseconds
Time: 1 millisecond
Time: 0 milliseconds
Time: 0 milliseconds
Time: 1 millisecond
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds

julia> include("Untitled.jl")
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 131 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds

julia> include("Untitled.jl")
Time: 1 millisecond
Time: 13 milliseconds
Time: 107 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 1 millisecond
Time: 0 milliseconds
Time: 0 milliseconds

julia> versioninfo()
Julia Version 1.11.0-DEV.291
Commit 30a73de681 (2023-08-17 02:32 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Xeon(R) Gold 6254 CPU @ 3.10GHz
  WORD_SIZE: 64
  LLVM: libLLVM-15.0.7 (ORCJIT, skylake-avx512)
  Threads: 1 on 8 virtual cores
@mbauman mbauman changed the title Strange issue in 1-10 and master Unusually long GC times in 1.10 and master Aug 17, 2023
@mbauman mbauman added performance Must go faster GC Garbage collector labels Aug 17, 2023
@gbaraldi
Copy link
Member

I can't reproduce on linux ;(

@d-netto
Copy link
Member

d-netto commented Aug 17, 2023

Was able to reproduce the slowdown on macOS, though was not as severe on my machine:

  • 1.9.2:
Time: 2 milliseconds
Time: 1 millisecond
Time: 1 millisecond
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
  • master:
Time: 2 milliseconds
Time: 1 millisecond
Time: 23 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Time: 0 milliseconds
Julia Version 1.9.2
Commit e4ee485e90* (2023-07-05 09:39 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin22.6.0)
  CPU: 12 × Apple M2 Max
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
  Threads: 1 on 8 virtual cores

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GC Garbage collector performance Must go faster
Projects
None yet
Development

No branches or pull requests

4 participants