Skip to content

Conversation

jaakkor2
Copy link

using SnoopCompileCore
invs = @snoop_invalidations using ProgressLogging
using SnoopCompile
length(uinvalidated(invs))

improves

  • 1.10.10 (lts) 312->136
  • 1.11.6 (release) 112->107
  • 1.12.0-rc2 276->147

Ref: JuliaLang/julia#59504

@jaakkor2
Copy link
Author

This PR improves TTFP of GLMakie on Julia 1.12.0-rc2, when ProgressLogging has been loaded

Julia v1.10.10 (LTS)

For reference

> julia +lts --startup-file=no --banner=no
julia> using ProgressLogging; @time using GLMakie; @time display(plot(rand(10)))
  3.676409 seconds (4.05 M allocations: 267.888 MiB, 5.89% gc time, 2.88% compilation time: 30% of which was recompilation)
  0.507509 seconds (128.96 k allocations: 13.300 MiB, 41.98% compilation time)

Julia v1.12.0-rc2

Without ProgressLogging

> julia +rc --startup-file=no --banner=no
julia> @time using GLMakie; @time display(plot(rand(10)))
  3.207026 seconds (5.28 M allocations: 302.216 MiB, 8.76% gc time, 16.19% compilation time: 91% of which was recompilation)
  0.530239 seconds (270.22 k allocations: 17.278 MiB, 42.26% compilation time: <1% of which was recompilation)
GLMakie.Screen(...)

With ProgressLogging v0.1.5

> julia +rc --startup-file=no --banner=no
julia> using ProgressLogging; @time using GLMakie; @time display(plot(rand(10)))
  3.180291 seconds (5.25 M allocations: 298.694 MiB, 9.25% gc time, 15.66% compilation time: 90% of which was recompilation)
  6.690593 seconds (30.71 M allocations: 1.538 GiB, 7.30% gc time, 95.38% compilation time: 83% of which was recompilation)

This PR

> julia +rc --startup-file=no --banner=no
julia> using ProgressLogging; @time using GLMakie; @time display(plot(rand(10)))
  3.141481 seconds (5.27 M allocations: 301.756 MiB, 8.74% gc time, 15.76% compilation time: 90% of which was recompilation)
  1.750266 seconds (4.12 M allocations: 216.110 MiB, 2.43% gc time, 82.57% compilation time: 67% of which was recompilation)

In summary, with this PR, TTFP goes down from 6.7 s to 1.8 s, clear improvement, but not yet the level of 0.5 s with LTS.

@jaakkor2
Copy link
Author

Removing the line

Base.convert(::Type{T}, str::ProgressString) where {T<:AbstractString} =
    convert(T, str.progress.name)

gets rid of the remaining invalidations. Tests of ProgressLogging.jl and TerminalLoggers.jl pass locally.

> julia +rc --startup-file=no --banner=no # Julia 1.12.0-rc2
julia> using ProgressLogging; @time using GLMakie; @time display(plot(rand(10)))
  3.253941 seconds (5.18 M allocations: 301.034 MiB, 8.93% gc time, 15.09% compilation time: 91% of which was recompilation)
  0.497792 seconds (258.49 k allocations: 16.721 MiB, 41.59% compilation time: <1% of which was recompilation)
GLMakie.Screen(...)
> julia +pr59648 --startup-file=no --banner=no # Development version 1.12.0-rc3.0
julia> using ProgressLogging; @time using GLMakie; @time display(plot(rand(10)))
  3.198127 seconds (5.18 M allocations: 300.921 MiB, 8.96% gc time, 15.47% compilation time: 89% of which was recompilation)
  0.509152 seconds (259.15 k allocations: 16.688 MiB, 42.73% compilation time: <1% of which was recompilation)
GLMakie.Screen(...)

@pfitzseb
Copy link
Member

Can you check whether progress logging still works in VS Code with this patch please? I don't think we rely on ProgressString there, but would be better to be sure.

@jaakkor2
Copy link
Author

Can you check whether progress logging still works in VS Code with this patch please? I don't think we rely on ProgressString there, but would be better to be sure.

using ProgressLogging
@progress for i in 1:10
    sleep(1)
end

shows at the bottom of the VS Code window

image

@jaakkor2
Copy link
Author

Works in Pluto.jl

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants