Skip to content

Too much lock contention? #247

@IanButterworth

Description

@IanButterworth

Trying to investigate this at the JuliaCon hackathon. Opening for discussion.

$ julia -t4

julia> function foo(url, n; downloader=()->Downloads.Downloader(;grace=0))
       Threads.@threads for _ in 1:n
           Downloads.download(url; downloader=downloader())
       end
       end
foo (generic function with 3 methods)

julia> @time foo("https://julialang-s3.julialang.org/bin/mac/aarch64/1.10/julia-1.10.4-macaarch64.dmg", 4, downloader=Returns(nothing))
 28.483014 seconds (916.99 k allocations: 659.244 MiB, 0.70% gc time, 22905 lock conflicts, 1.15% compilation time)

julia> @time foo("https://julialang-s3.julialang.org/bin/mac/aarch64/1.10/julia-1.10.4-macaarch64.dmg", 4)
 26.974909 seconds (1.23 M allocations: 675.870 MiB, 0.82% gc time, 1801 lock conflicts, 1.32% compilation time)

Note 1801 lock conflicts even on the task local Downloader version

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions