10-15 minute TTFP with Plots.jl... Please help

TLDR: I spend half my day staring at Precompiling project...

I hear people talking a lot about improvements in time to first plot, but I’m not seeing it. My TTPF is still on the order of 10-15 minutes. This is the test script I ran:

@time @eval begin
    import Pkg
    Pkg.activate(;temp=true)
    Pkg.add("Plots")
    using Plots
    display(plot(rand(10)))
    versioninfo()
end

And these are my results:

bad

This problem goes away the second time I plot in the same sitting, but when I come back a couple days later to plot something else, the problem is back. I don’t plot very frequently because manually poking around the data for 2-3 minutes is 5x faster and usually more useful than looking at a plot.

Some things that I am willing to compromise on:

  • I’m happy to have (prefer) all my environments use the same version of Plots.jl
  • I’m willing to work with an out of date version of Plots.jl. I’d be fine with receiving update annually or only when I explicitly ask for updates so long as my 10-15 minute TTFP is predictably confined to those times
  • I’m willing to do pretty much anything it takes with respect to environments and Project.toml. Ideally it would β€œjust work” and I could type using Plots from any environment and get a reasonable TTFP, but I’m willing to jump through hoops if that’s the only option

Some things I’m not willing to compromise on

  • I never want a 10-15 minute delay to spring up on me when I’m not working with Plots.jl or some other large package. ]add Reexport; using Reexport should always be fast.
  • I don’t want to and/or don’t have the authority to clutter the Project.toml of registered packages which I maintain.

Is anyone else experiencing this ridiculous TTFP?

Here are the full details of how I got the data plotted above in the form of pasted REPL output

1.0.5
x@X ~ % julia +1.0 --startup-file=no
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _' |  |
  | | |_| | | | (_| |  |  Version 1.0.5 (2019-09-09)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |
[...]
julia> @time @eval begin
           import Pkg
           Pkg.add("Plots")
           using Plots
           display(plot(rand(10)))
           versioninfo()
       end
 Resolving package versions...
 Installed Showoff ────────── v0.3.2
 Installed SpecialFunctions ─ v0.8.0
 Installed SnoopPrecompile ── v1.0.2
 Installed BinaryProvider ─── v0.5.10
 Installed PlotThemes ─────── v2.0.1
 Installed Plots ──────────── v1.4.3
 Installed FFMPEG ─────────── v0.2.4
 Installed Parsers ────────── v2.4.2
 Installed HTTP ───────────── v0.8.19
 Installed RecipesPipeline ── v0.1.13
 Installed RecipesBase ────── v1.2.1
 Installed PlotUtils ──────── v1.0.15
 Installed GeometryTypes ──── v0.8.5
 Installed Contour ────────── v0.5.7
 Installed BinDeps ────────── v1.0.2
 Installed URIParser ──────── v0.4.1
 Installed StaticArrays ───── v1.3.6
 Installed GR ─────────────── v0.50.1
 Installed Reexport ───────── v0.2.0
 Installed MbedTLS ────────── v0.6.8
 Installed ChainRulesCore ─── v1.12.2
  Updating `~/.julia/environments/v1.0/Project.toml`
  [91a5bcdd] + Plots v1.4.3
  Updating `~/.julia/environments/v1.0/Manifest.toml`
  [9e28174c] + BinDeps v1.0.2
  [b99e7846] + BinaryProvider v0.5.10
  [d360d2e6] + ChainRulesCore v1.12.2
  [9e997f8a] + ChangesOfVariables v0.1.4
  [35d6a980] + ColorSchemes v3.20.0
  [3da002f7] + ColorTypes v0.11.4
  [c3611d14] + ColorVectorSpace v0.9.9
  [5ae59095] + Colors v0.12.10
  [34da2185] + Compat v3.46.0
  [d38c429a] + Contour v0.5.7
  [9a962f9c] + DataAPI v1.14.0
  [864edb3b] + DataStructures v0.18.13
  [ffbed154] + DocStringExtensions v0.9.3
  [c87230d0] + FFMPEG v0.2.4
  [53c48c17] + FixedPointNumbers v0.8.4
  [28b8d3ca] + GR v0.50.1
  [4d00f742] + GeometryTypes v0.8.5
  [42e2da0e] + Grisu v1.0.2
  [cd3eb016] + HTTP v0.8.19
  [83e8ac13] + IniFile v0.5.1
  [3587e190] + InverseFunctions v0.1.8
  [92d709cd] + IrrationalConstants v0.1.1
  [682c06a0] + JSON v0.21.3
  [2ab3a3ac] + LogExpFunctions v0.3.19
  [739be429] + MbedTLS v0.6.8
  [442fdcdd] + Measures v0.3.2
  [e1d29d7a] + Missings v1.1.0
  [77ba4419] + NaNMath v0.3.7
  [69de0a69] + Parsers v2.4.2
  [ccf2f8ad] + PlotThemes v2.0.1
  [995b91a9] + PlotUtils v1.0.15
  [91a5bcdd] + Plots v1.4.3
  [3cdcf5f2] + RecipesBase v1.2.1
  [01d81517] + RecipesPipeline v0.1.13
  [189a3867] + Reexport v0.2.0
  [992d4aef] + Showoff v0.3.2
  [66db9d55] + SnoopPrecompile v1.0.2
  [a2af1166] + SortingAlgorithms v1.1.0
  [276daf66] + SpecialFunctions v0.8.0
  [90137ffa] + StaticArrays v1.3.6
  [82ae8749] + StatsAPI v1.5.0
  [2913bbd2] + StatsBase v0.33.21
  [62fd8b95] + TensorCore v0.1.1
  [30578b45] + URIParser v0.4.1
  [8bb1440f] + DelimitedFiles 
  [56ddb016] + Logging 
  [a63ad114] + Mmap 
  [1a1011a3] + SharedArrays 
  [2f01184e] + SparseArrays 
  [10745b16] + Statistics 
  [8dfed614] + Test 
  Building MbedTLS ─────────→ `~/.julia/packages/MbedTLS/X4xar/deps/build.log`
  Building GR ──────────────→ `~/.julia/packages/GR/Atztx/deps/build.log`
  Building SpecialFunctions β†’ `~/.julia/packages/SpecialFunctions/ne2iw/deps/build.log`
  Building FFMPEG ──────────→ `~/.julia/packages/FFMPEG/guN1x/deps/build.log`
  Building Plots ───────────→ `~/.julia/packages/Plots/E3MWZ/deps/build.log`
[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
Julia Version 1.0.5
Commit 3af96bcefc (2019-09-09 19:06 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.6.0)
  CPU: Intel(R) Core(TM) i5-8210Y CPU @ 1.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
979.479078 seconds (44.20 M allocations: 2.361 GiB, 0.53% gc time)

julia> 
1.8.4
x@X ~ % julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _' |  |
  | | |_| | | | (_| |  |  Version 1.8.4 (2022-12-23)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> @time @eval begin
           import Pkg
           Pkg.add("Plots")
           using Plots
           display(plot(rand(10)))
           versioninfo()
       end
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
    Updating `~/.julia/environments/v1.8/Project.toml`
  [91a5bcdd] + Plots v1.38.1
    Updating `~/.julia/environments/v1.8/Manifest.toml`
  [d1d4a3ce] + BitFlags v0.1.7
  [944b1d66] + CodecZlib v0.7.0
  [35d6a980] + ColorSchemes v3.20.0
  [3da002f7] + ColorTypes v0.11.4
  [c3611d14] + ColorVectorSpace v0.9.10
  [5ae59095] + Colors v0.12.10
  [d38c429a] + Contour v0.6.2
  [c87230d0] + FFMPEG v0.4.1
  [53c48c17] + FixedPointNumbers v0.8.4
  [59287772] + Formatting v0.4.2
  [28b8d3ca] + GR v0.71.3
  [42e2da0e] + Grisu v1.0.2
  [cd3eb016] + HTTP v1.6.3
  [83e8ac13] + IniFile v0.5.1
  [1019f520] + JLFzf v0.1.5
  [692b3bcd] + JLLWrappers v1.4.1
  [b964fa9f] + LaTeXStrings v1.3.0
  [23fbe1c1] + Latexify v0.15.17
  [e6f89c97] + LoggingExtras v1.0.0
  [1914dd2f] + MacroTools v0.5.10
  [739be429] + MbedTLS v1.1.7
  [442fdcdd] + Measures v0.3.2
  [77ba4419] + NaNMath v1.0.1
  [4d8831e6] + OpenSSL v1.3.2
  [b98c9c47] + Pipe v1.3.0
  [ccf2f8ad] + PlotThemes v3.1.0
  [995b91a9] + PlotUtils v1.3.2
  [91a5bcdd] + Plots v1.38.1
  [21216c6a] + Preferences v1.3.0
  [01d81517] + RecipesPipeline v0.6.11
  [189a3867] + Reexport v1.2.2
  [05181044] + RelocatableFolders v1.0.0
  [992d4aef] + Showoff v1.0.3
  [777ac1f9] + SimpleBufferStream v1.1.0
  [276daf66] + SpecialFunctions v2.1.7
  [62fd8b95] + TensorCore v0.1.1
  [3bb67fe8] + TranscodingStreams v0.9.10
  [5c2747f8] + URIs v1.4.1
  [1cfade01] + UnicodeFun v0.4.1
  [41fe7b60] + Unzip v0.2.0
  [6e34b625] + Bzip2_jll v1.0.8+0
  [83423d85] + Cairo_jll v1.16.1+1
  [2e619515] + Expat_jll v2.4.8+0
  [b22a6f82] + FFMPEG_jll v4.4.2+2
  [a3f928ae] + Fontconfig_jll v2.13.93+0
  [d7e528f0] + FreeType2_jll v2.10.4+0
  [559328eb] + FriBidi_jll v1.0.10+0
  [0656b61e] + GLFW_jll v3.3.8+0
  [d2c73de3] + GR_jll v0.71.3+0
  [78b55507] + Gettext_jll v0.21.0+0
  [7746bdde] + Glib_jll v2.74.0+2
  [3b182d85] + Graphite2_jll v1.3.14+0
  [2e76f6c2] + HarfBuzz_jll v2.8.1+1
  [aacddb02] + JpegTurbo_jll v2.1.2+0
  [c1c5ebd0] + LAME_jll v3.100.1+0
  [88015f11] + LERC_jll v3.0.0+1
  [dd4b983a] + LZO_jll v2.10.1+0
βŒ… [e9f186c6] + Libffi_jll v3.2.2+1
  [d4300ac3] + Libgcrypt_jll v1.8.7+0
  [7e76a0d4] + Libglvnd_jll v1.6.0+0
  [7add5ba3] + Libgpg_error_jll v1.42.0+0
  [94ce4f54] + Libiconv_jll v1.16.1+2
  [4b2f31a3] + Libmount_jll v2.35.0+0
  [89763e89] + Libtiff_jll v4.4.0+0
  [38a345b3] + Libuuid_jll v2.36.0+0
  [e7412a2a] + Ogg_jll v1.3.5+1
  [458c3c95] + OpenSSL_jll v1.1.19+0
  [efe28fd5] + OpenSpecFun_jll v0.5.5+0
  [91d4177d] + Opus_jll v1.3.2+0
  [30392449] + Pixman_jll v0.40.1+0
  [ea2cea3b] + Qt5Base_jll v5.15.3+2
  [a2964d1f] + Wayland_jll v1.21.0+0
  [2381bf8a] + Wayland_protocols_jll v1.25.0+0
  [02c8fc9c] + XML2_jll v2.10.3+0
  [aed1982a] + XSLT_jll v1.1.34+0
  [4f6342f7] + Xorg_libX11_jll v1.6.9+4
  [0c0b7dd1] + Xorg_libXau_jll v1.0.9+4
  [935fb764] + Xorg_libXcursor_jll v1.2.0+4
  [a3789734] + Xorg_libXdmcp_jll v1.1.3+4
  [1082639a] + Xorg_libXext_jll v1.3.4+4
  [d091e8ba] + Xorg_libXfixes_jll v5.0.3+4
  [a51aa0fd] + Xorg_libXi_jll v1.7.10+4
  [d1454406] + Xorg_libXinerama_jll v1.1.4+4
  [ec84b674] + Xorg_libXrandr_jll v1.5.2+4
  [ea2f1a96] + Xorg_libXrender_jll v0.9.10+4
  [14d82f49] + Xorg_libpthread_stubs_jll v0.1.0+3
  [c7cfdc94] + Xorg_libxcb_jll v1.13.0+3
  [cc61e674] + Xorg_libxkbfile_jll v1.1.0+4
  [12413925] + Xorg_xcb_util_image_jll v0.4.0+1
  [2def613f] + Xorg_xcb_util_jll v0.4.0+1
  [975044d2] + Xorg_xcb_util_keysyms_jll v0.4.0+1
  [0d47668e] + Xorg_xcb_util_renderutil_jll v0.3.9+1
  [c22f9ab0] + Xorg_xcb_util_wm_jll v0.4.1+1
  [35661453] + Xorg_xkbcomp_jll v1.4.2+4
  [33bec58e] + Xorg_xkeyboard_config_jll v2.27.0+4
  [c5fb5394] + Xorg_xtrans_jll v1.4.0+3
  [3161d3a3] + Zstd_jll v1.5.2+0
βŒ… [214eeab7] + fzf_jll v0.29.0+0
  [a4ae2306] + libaom_jll v3.4.0+0
  [0ac62f75] + libass_jll v0.15.1+0
  [f638f0a6] + libfdk_aac_jll v2.0.2+0
  [b53b4c65] + libpng_jll v1.6.38+0
  [f27f6e37] + libvorbis_jll v1.3.7+1
  [1270edf5] + x264_jll v2021.5.5+0
  [dfaa095f] + x265_jll v3.5.0+0
  [d8fb68d0] + xkbcommon_jll v1.4.1+0
  [8bb1440f] + DelimitedFiles
  [e66e0078] ↑ CompilerSupportLibraries_jll v0.5.2+0 β‡’ v1.0.1+0
  [05823500] + OpenLibm_jll v0.8.1+0
  [efcefdf7] + PCRE2_jll v10.40.0+0
        Info Packages marked with βŒ… have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
Precompiling project...
  13 dependencies successfully precompiled in 508 seconds. 132 already precompiled.
Julia Version 1.8.4
Commit 00177ebc4fc (2022-12-23 21:32 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin21.4.0)
  CPU: 4 Γ— Intel(R) Core(TM) i5-8210Y CPU @ 1.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
  Threads: 1 on 2 virtual cores
Environment:
  DYLD_FALLBACK_LIBRARY_PATH = /Users/x/.julia/artifacts/979f68ce65b....x64.apple.darwin14/bin/../lib:
610.476176 seconds (15.68 M allocations: 1.050 GiB, 1.58% gc time, 11.77% compilation time: 0% of which was recompilation)

julia> 
1.9.0-beta2
x@X ~ % julia +beta     
[ Info: Precompiling Revise [295af30f-e4ad-537b-8983-00126c2a3abe]
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _' |  |
  | | |_| | | | (_| |  |  Version 1.9.0-beta2 (2022-12-29)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> @time @eval begin
           import Pkg
           Pkg.activate(;temp=true)
           Pkg.add("Plots")
           using Plots
           display(plot(rand(10)))
           versioninfo()
       end
  Activating new project at `/var/folders/hc/fn82kz1j5vl8w7lwd4l079y80000gn/T/jl_LDvsFu`
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
    Updating `/private/var/folders/hc/fn82kz1j5vl8w7lwd4l079y80000gn/T/jl_LDvsFu/Project.toml`
  [91a5bcdd] + Plots v1.38.1
    Updating `/private/var/folders/hc/fn82kz1j5vl8w7lwd4l079y80000gn/T/jl_LDvsFu/Manifest.toml`
  [d1d4a3ce] + BitFlags v0.1.7
  [d360d2e6] + ChainRulesCore v1.15.6
  [9e997f8a] + ChangesOfVariables v0.1.4
  [944b1d66] + CodecZlib v0.7.0
  [35d6a980] + ColorSchemes v3.20.0
  [3da002f7] + ColorTypes v0.11.4
  [c3611d14] + ColorVectorSpace v0.9.10
  [5ae59095] + Colors v0.12.10
  [34da2185] + Compat v4.5.0
  [d38c429a] + Contour v0.6.2
  [9a962f9c] + DataAPI v1.14.0
  [864edb3b] + DataStructures v0.18.13
  [8bb1440f] + DelimitedFiles v1.9.1
  [ffbed154] + DocStringExtensions v0.9.3
  [c87230d0] + FFMPEG v0.4.1
  [53c48c17] + FixedPointNumbers v0.8.4
  [59287772] + Formatting v0.4.2
  [28b8d3ca] + GR v0.71.3
  [42e2da0e] + Grisu v1.0.2
  [cd3eb016] + HTTP v1.6.3
  [83e8ac13] + IniFile v0.5.1
  [3587e190] + InverseFunctions v0.1.8
  [92d709cd] + IrrationalConstants v0.1.1
  [1019f520] + JLFzf v0.1.5
  [692b3bcd] + JLLWrappers v1.4.1
  [682c06a0] + JSON v0.21.3
  [b964fa9f] + LaTeXStrings v1.3.0
  [23fbe1c1] + Latexify v0.15.17
  [2ab3a3ac] + LogExpFunctions v0.3.19
  [e6f89c97] + LoggingExtras v1.0.0
  [1914dd2f] + MacroTools v0.5.10
  [739be429] + MbedTLS v1.1.7
  [442fdcdd] + Measures v0.3.2
  [e1d29d7a] + Missings v1.1.0
  [77ba4419] + NaNMath v1.0.1
  [4d8831e6] + OpenSSL v1.3.2
  [bac558e1] + OrderedCollections v1.4.1
  [69de0a69] + Parsers v2.5.2
  [b98c9c47] + Pipe v1.3.0
  [ccf2f8ad] + PlotThemes v3.1.0
  [995b91a9] + PlotUtils v1.3.2
  [91a5bcdd] + Plots v1.38.1
  [21216c6a] + Preferences v1.3.0
  [3cdcf5f2] + RecipesBase v1.3.2
  [01d81517] + RecipesPipeline v0.6.11
  [189a3867] + Reexport v1.2.2
  [05181044] + RelocatableFolders v1.0.0
  [ae029012] + Requires v1.3.0
  [6c6a2e73] + Scratch v1.1.1
  [992d4aef] + Showoff v1.0.3
  [777ac1f9] + SimpleBufferStream v1.1.0
  [66db9d55] + SnoopPrecompile v1.0.1
  [a2af1166] + SortingAlgorithms v1.1.0
  [276daf66] + SpecialFunctions v2.1.7
  [82ae8749] + StatsAPI v1.5.0
  [2913bbd2] + StatsBase v0.33.21
  [62fd8b95] + TensorCore v0.1.1
  [3bb67fe8] + TranscodingStreams v0.9.10
  [5c2747f8] + URIs v1.4.1
  [1cfade01] + UnicodeFun v0.4.1
  [41fe7b60] + Unzip v0.2.0
  [6e34b625] + Bzip2_jll v1.0.8+0
  [83423d85] + Cairo_jll v1.16.1+1
  [2e619515] + Expat_jll v2.4.8+0
  [b22a6f82] + FFMPEG_jll v4.4.2+2
  [a3f928ae] + Fontconfig_jll v2.13.93+0
  [d7e528f0] + FreeType2_jll v2.10.4+0
  [559328eb] + FriBidi_jll v1.0.10+0
  [0656b61e] + GLFW_jll v3.3.8+0
  [d2c73de3] + GR_jll v0.71.3+0
  [78b55507] + Gettext_jll v0.21.0+0
  [7746bdde] + Glib_jll v2.74.0+2
  [3b182d85] + Graphite2_jll v1.3.14+0
  [2e76f6c2] + HarfBuzz_jll v2.8.1+1
  [aacddb02] + JpegTurbo_jll v2.1.2+0
  [c1c5ebd0] + LAME_jll v3.100.1+0
  [88015f11] + LERC_jll v3.0.0+1
  [dd4b983a] + LZO_jll v2.10.1+0
βŒ… [e9f186c6] + Libffi_jll v3.2.2+1
  [d4300ac3] + Libgcrypt_jll v1.8.7+0
  [7e76a0d4] + Libglvnd_jll v1.6.0+0
  [7add5ba3] + Libgpg_error_jll v1.42.0+0
  [94ce4f54] + Libiconv_jll v1.16.1+2
  [4b2f31a3] + Libmount_jll v2.35.0+0
  [89763e89] + Libtiff_jll v4.4.0+0
  [38a345b3] + Libuuid_jll v2.36.0+0
  [e7412a2a] + Ogg_jll v1.3.5+1
  [458c3c95] + OpenSSL_jll v1.1.19+0
  [efe28fd5] + OpenSpecFun_jll v0.5.5+0
  [91d4177d] + Opus_jll v1.3.2+0
  [30392449] + Pixman_jll v0.40.1+0
  [ea2cea3b] + Qt5Base_jll v5.15.3+2
  [a2964d1f] + Wayland_jll v1.21.0+0
  [2381bf8a] + Wayland_protocols_jll v1.25.0+0
  [02c8fc9c] + XML2_jll v2.10.3+0
  [aed1982a] + XSLT_jll v1.1.34+0
  [4f6342f7] + Xorg_libX11_jll v1.6.9+4
  [0c0b7dd1] + Xorg_libXau_jll v1.0.9+4
  [935fb764] + Xorg_libXcursor_jll v1.2.0+4
  [a3789734] + Xorg_libXdmcp_jll v1.1.3+4
  [1082639a] + Xorg_libXext_jll v1.3.4+4
  [d091e8ba] + Xorg_libXfixes_jll v5.0.3+4
  [a51aa0fd] + Xorg_libXi_jll v1.7.10+4
  [d1454406] + Xorg_libXinerama_jll v1.1.4+4
  [ec84b674] + Xorg_libXrandr_jll v1.5.2+4
  [ea2f1a96] + Xorg_libXrender_jll v0.9.10+4
  [14d82f49] + Xorg_libpthread_stubs_jll v0.1.0+3
  [c7cfdc94] + Xorg_libxcb_jll v1.13.0+3
  [cc61e674] + Xorg_libxkbfile_jll v1.1.0+4
  [12413925] + Xorg_xcb_util_image_jll v0.4.0+1
  [2def613f] + Xorg_xcb_util_jll v0.4.0+1
  [975044d2] + Xorg_xcb_util_keysyms_jll v0.4.0+1
  [0d47668e] + Xorg_xcb_util_renderutil_jll v0.3.9+1
  [c22f9ab0] + Xorg_xcb_util_wm_jll v0.4.1+1
  [35661453] + Xorg_xkbcomp_jll v1.4.2+4
  [33bec58e] + Xorg_xkeyboard_config_jll v2.27.0+4
  [c5fb5394] + Xorg_xtrans_jll v1.4.0+3
  [3161d3a3] + Zstd_jll v1.5.2+0
βŒ… [214eeab7] + fzf_jll v0.29.0+0
  [a4ae2306] + libaom_jll v3.4.0+0
  [0ac62f75] + libass_jll v0.15.1+0
  [f638f0a6] + libfdk_aac_jll v2.0.2+0
  [b53b4c65] + libpng_jll v1.6.38+0
  [f27f6e37] + libvorbis_jll v1.3.7+1
  [1270edf5] + x264_jll v2021.5.5+0
  [dfaa095f] + x265_jll v3.5.0+0
  [d8fb68d0] + xkbcommon_jll v1.4.1+0
  [0dad84c5] + ArgTools v1.1.1
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching
  [b77e0a4c] + InteractiveUtils
  [b27032c2] + LibCURL v0.6.3
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.8.0
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics v1.9.0
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [e66e0078] + CompilerSupportLibraries_jll v1.0.2+0
  [deac9b47] + LibCURL_jll v7.84.0+0
  [29816b5a] + LibSSH2_jll v1.10.2+0
  [c8ffd9c3] + MbedTLS_jll v2.28.0+0
  [14a3606d] + MozillaCACerts_jll v2022.10.11
  [4536629a] + OpenBLAS_jll v0.3.21+0
  [05823500] + OpenLibm_jll v0.8.1+0
  [efcefdf7] + PCRE2_jll v10.42.0+0
  [bea87d4a] + SuiteSparse_jll v5.10.1+0
  [83775a58] + Zlib_jll v1.2.13+0
  [8e850b90] + libblastrampoline_jll v5.2.0+0
  [8e850ede] + nghttp2_jll v1.48.0+0
  [3f19e933] + p7zip_jll v17.4.0+0
        Info Packages marked with βŒ… have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
Precompiling environment...
  133 dependencies successfully precompiled in 922 seconds. 1 already precompiled.
Julia Version 1.9.0-beta2
Commit 7daffeecb8c (2022-12-29 07:45 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin21.4.0)
  CPU: 4 Γ— Intel(R) Core(TM) i5-8210Y CPU @ 1.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 1 on 2 virtual cores
Environment:
  DYLD_FALLBACK_LIBRARY_PATH = /Users/x/.julia/artifacts/979f68ce...x64.apple.darwin14/bin/../lib:
946.782474 seconds (13.61 M allocations: 950.276 MiB, 0.52% gc time, 1.01% compilation time: 36% of which was recompilation)

julia> 
1.10.0-DEV.246
x@X ~ % .julia/dev/julia_master/julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _' |  |
  | | |_| | | | (_| |  |  Version 1.10.0-DEV.246 (2022-12-30)
 _/ |\__'_|_|_|\__'_|  |  Commit 4d206c97c7 (7 days old master)
|__/                   |

julia> @time @eval begin
           import Pkg
           Pkg.activate(;temp=true)
           Pkg.add("Plots")
           using Plots
           display(plot(rand(10)))
           versioninfo()
       end
  Activating new project at `/var/folders/hc/fn82kz1j5vl8w7lwd4l079y80000gn/T/jl_3i7Jtu`
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
    Updating `/private/var/folders/hc/fn82kz1j5vl8w7lwd4l079y80000gn/T/jl_3i7Jtu/Project.toml`
  [91a5bcdd] + Plots v1.38.1
    Updating `/private/var/folders/hc/fn82kz1j5vl8w7lwd4l079y80000gn/T/jl_3i7Jtu/Manifest.toml`
  [d1d4a3ce] + BitFlags v0.1.7
  [d360d2e6] + ChainRulesCore v1.15.6
  [9e997f8a] + ChangesOfVariables v0.1.4
  [944b1d66] + CodecZlib v0.7.0
  [35d6a980] + ColorSchemes v3.20.0
  [3da002f7] + ColorTypes v0.11.4
  [c3611d14] + ColorVectorSpace v0.9.10
  [5ae59095] + Colors v0.12.10
  [34da2185] + Compat v4.5.0
  [d38c429a] + Contour v0.6.2
  [9a962f9c] + DataAPI v1.14.0
  [864edb3b] + DataStructures v0.18.13
  [8bb1440f] + DelimitedFiles v1.9.1
  [ffbed154] + DocStringExtensions v0.9.3
  [c87230d0] + FFMPEG v0.4.1
  [53c48c17] + FixedPointNumbers v0.8.4
  [59287772] + Formatting v0.4.2
  [28b8d3ca] + GR v0.71.3
  [42e2da0e] + Grisu v1.0.2
  [cd3eb016] + HTTP v1.6.3
  [83e8ac13] + IniFile v0.5.1
  [3587e190] + InverseFunctions v0.1.8
  [92d709cd] + IrrationalConstants v0.1.1
  [1019f520] + JLFzf v0.1.5
  [692b3bcd] + JLLWrappers v1.4.1
  [682c06a0] + JSON v0.21.3
  [b964fa9f] + LaTeXStrings v1.3.0
  [23fbe1c1] + Latexify v0.15.17
  [2ab3a3ac] + LogExpFunctions v0.3.19
  [e6f89c97] + LoggingExtras v1.0.0
  [1914dd2f] + MacroTools v0.5.10
  [739be429] + MbedTLS v1.1.7
  [442fdcdd] + Measures v0.3.2
  [e1d29d7a] + Missings v1.1.0
  [77ba4419] + NaNMath v1.0.1
  [4d8831e6] + OpenSSL v1.3.2
  [bac558e1] + OrderedCollections v1.4.1
  [69de0a69] + Parsers v2.5.2
  [b98c9c47] + Pipe v1.3.0
  [ccf2f8ad] + PlotThemes v3.1.0
  [995b91a9] + PlotUtils v1.3.2
  [91a5bcdd] + Plots v1.38.1
  [21216c6a] + Preferences v1.3.0
  [3cdcf5f2] + RecipesBase v1.3.2
  [01d81517] + RecipesPipeline v0.6.11
  [189a3867] + Reexport v1.2.2
  [05181044] + RelocatableFolders v1.0.0
  [ae029012] + Requires v1.3.0
  [6c6a2e73] + Scratch v1.1.1
  [992d4aef] + Showoff v1.0.3
  [777ac1f9] + SimpleBufferStream v1.1.0
  [66db9d55] + SnoopPrecompile v1.0.1
  [a2af1166] + SortingAlgorithms v1.1.0
  [276daf66] + SpecialFunctions v2.1.7
  [82ae8749] + StatsAPI v1.5.0
  [2913bbd2] + StatsBase v0.33.21
  [62fd8b95] + TensorCore v0.1.1
  [3bb67fe8] + TranscodingStreams v0.9.10
  [5c2747f8] + URIs v1.4.1
  [1cfade01] + UnicodeFun v0.4.1
  [41fe7b60] + Unzip v0.2.0
  [6e34b625] + Bzip2_jll v1.0.8+0
  [83423d85] + Cairo_jll v1.16.1+1
  [2e619515] + Expat_jll v2.4.8+0
  [b22a6f82] + FFMPEG_jll v4.4.2+2
  [a3f928ae] + Fontconfig_jll v2.13.93+0
  [d7e528f0] + FreeType2_jll v2.10.4+0
  [559328eb] + FriBidi_jll v1.0.10+0
  [0656b61e] + GLFW_jll v3.3.8+0
  [d2c73de3] + GR_jll v0.71.3+0
  [78b55507] + Gettext_jll v0.21.0+0
  [7746bdde] + Glib_jll v2.74.0+2
  [3b182d85] + Graphite2_jll v1.3.14+0
  [2e76f6c2] + HarfBuzz_jll v2.8.1+1
  [aacddb02] + JpegTurbo_jll v2.1.2+0
  [c1c5ebd0] + LAME_jll v3.100.1+0
  [88015f11] + LERC_jll v3.0.0+1
  [dd4b983a] + LZO_jll v2.10.1+0
βŒ… [e9f186c6] + Libffi_jll v3.2.2+1
  [d4300ac3] + Libgcrypt_jll v1.8.7+0
  [7e76a0d4] + Libglvnd_jll v1.6.0+0
  [7add5ba3] + Libgpg_error_jll v1.42.0+0
  [94ce4f54] + Libiconv_jll v1.16.1+2
  [4b2f31a3] + Libmount_jll v2.35.0+0
  [89763e89] + Libtiff_jll v4.4.0+0
  [38a345b3] + Libuuid_jll v2.36.0+0
  [e7412a2a] + Ogg_jll v1.3.5+1
  [458c3c95] + OpenSSL_jll v1.1.19+0
  [efe28fd5] + OpenSpecFun_jll v0.5.5+0
  [91d4177d] + Opus_jll v1.3.2+0
  [30392449] + Pixman_jll v0.40.1+0
  [ea2cea3b] + Qt5Base_jll v5.15.3+2
  [a2964d1f] + Wayland_jll v1.21.0+0
  [2381bf8a] + Wayland_protocols_jll v1.25.0+0
  [02c8fc9c] + XML2_jll v2.10.3+0
  [aed1982a] + XSLT_jll v1.1.34+0
  [4f6342f7] + Xorg_libX11_jll v1.6.9+4
  [0c0b7dd1] + Xorg_libXau_jll v1.0.9+4
  [935fb764] + Xorg_libXcursor_jll v1.2.0+4
  [a3789734] + Xorg_libXdmcp_jll v1.1.3+4
  [1082639a] + Xorg_libXext_jll v1.3.4+4
  [d091e8ba] + Xorg_libXfixes_jll v5.0.3+4
  [a51aa0fd] + Xorg_libXi_jll v1.7.10+4
  [d1454406] + Xorg_libXinerama_jll v1.1.4+4
  [ec84b674] + Xorg_libXrandr_jll v1.5.2+4
  [ea2f1a96] + Xorg_libXrender_jll v0.9.10+4
  [14d82f49] + Xorg_libpthread_stubs_jll v0.1.0+3
  [c7cfdc94] + Xorg_libxcb_jll v1.13.0+3
  [cc61e674] + Xorg_libxkbfile_jll v1.1.0+4
  [12413925] + Xorg_xcb_util_image_jll v0.4.0+1
  [2def613f] + Xorg_xcb_util_jll v0.4.0+1
  [975044d2] + Xorg_xcb_util_keysyms_jll v0.4.0+1
  [0d47668e] + Xorg_xcb_util_renderutil_jll v0.3.9+1
  [c22f9ab0] + Xorg_xcb_util_wm_jll v0.4.1+1
  [35661453] + Xorg_xkbcomp_jll v1.4.2+4
  [33bec58e] + Xorg_xkeyboard_config_jll v2.27.0+4
  [c5fb5394] + Xorg_xtrans_jll v1.4.0+3
  [3161d3a3] + Zstd_jll v1.5.2+0
βŒ… [214eeab7] + fzf_jll v0.29.0+0
  [a4ae2306] + libaom_jll v3.4.0+0
  [0ac62f75] + libass_jll v0.15.1+0
  [f638f0a6] + libfdk_aac_jll v2.0.2+0
  [b53b4c65] + libpng_jll v1.6.38+0
  [f27f6e37] + libvorbis_jll v1.3.7+1
  [1270edf5] + x264_jll v2021.5.5+0
  [dfaa095f] + x265_jll v3.5.0+0
  [d8fb68d0] + xkbcommon_jll v1.4.1+0
  [0dad84c5] + ArgTools v1.1.1
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching
  [b77e0a4c] + InteractiveUtils
  [b27032c2] + LibCURL v0.6.3
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.8.0
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics v1.9.0
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [e66e0078] + CompilerSupportLibraries_jll v1.0.2+0
  [deac9b47] + LibCURL_jll v7.84.0+0
  [29816b5a] + LibSSH2_jll v1.10.2+0
  [c8ffd9c3] + MbedTLS_jll v2.28.0+0
  [14a3606d] + MozillaCACerts_jll v2022.10.11
  [4536629a] + OpenBLAS_jll v0.3.21+0
  [05823500] + OpenLibm_jll v0.8.1+0
  [efcefdf7] + PCRE2_jll v10.42.0+0
  [bea87d4a] + SuiteSparse_jll v5.10.1+0
  [83775a58] + Zlib_jll v1.2.13+0
  [8e850b90] + libblastrampoline_jll v5.2.0+0
  [8e850ede] + nghttp2_jll v1.48.0+0
  [3f19e933] + p7zip_jll v17.4.0+0
        Info Packages marked with βŒ… have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
Precompiling environment...
  131 dependencies successfully precompiled in 916 seconds. 3 already precompiled.
Julia Version 1.10.0-DEV.246
Commit 4d206c97c7 (2022-12-30 15:07 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin21.3.0)
  CPU: 4 Γ— Intel(R) Core(TM) i5-8210Y CPU @ 1.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 1 on 2 virtual cores
Environment:
  JULIA_IMAGE_THREADS = 1
  DYLD_FALLBACK_LIBRARY_PATH = /Users/x/.julia/artifacts/979f68ce6...lia_master/usr/bin/../lib:
939.996266 seconds (12.46 M allocations: 850.937 MiB, 0.52% gc time, 0.60% compilation time: <1% of which was recompilation)
2 Likes

Create a sysimage with Plots in it using PackageCompiler. Make an alias to Julia that uses that sysimage by default. Use that alias.

1 Like

With a clean ~/.julia/compiled/v1.10 directory, so that I’m including whole precompilation time:

% ./julia /tmp/foo.jl
  Activating new project at `/var/folders/v2/hmy3kzgj4tb3xsy8qkltxd0r0000gn/T/jl_oEFG7g`
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
    Updating `/private/var/folders/v2/hmy3kzgj4tb3xsy8qkltxd0r0000gn/T/jl_oEFG7g/Project.toml`
  [91a5bcdd] + Plots v1.38.1
    Updating `/private/var/folders/v2/hmy3kzgj4tb3xsy8qkltxd0r0000gn/T/jl_oEFG7g/Manifest.toml`
  [d1d4a3ce] + BitFlags v0.1.7
  [d360d2e6] + ChainRulesCore v1.15.6
  [9e997f8a] + ChangesOfVariables v0.1.4
  [944b1d66] + CodecZlib v0.7.0
  [35d6a980] + ColorSchemes v3.20.0
  [3da002f7] + ColorTypes v0.11.4
  [c3611d14] + ColorVectorSpace v0.9.10
  [5ae59095] + Colors v0.12.10
  [34da2185] + Compat v4.5.0
  [d38c429a] + Contour v0.6.2
  [9a962f9c] + DataAPI v1.14.0
  [864edb3b] + DataStructures v0.18.13
  [8bb1440f] + DelimitedFiles v1.9.1
  [ffbed154] + DocStringExtensions v0.9.3
  [c87230d0] + FFMPEG v0.4.1
  [53c48c17] + FixedPointNumbers v0.8.4
  [59287772] + Formatting v0.4.2
  [28b8d3ca] + GR v0.71.3
  [42e2da0e] + Grisu v1.0.2
  [cd3eb016] + HTTP v1.6.3
  [83e8ac13] + IniFile v0.5.1
  [3587e190] + InverseFunctions v0.1.8
  [92d709cd] + IrrationalConstants v0.1.1
  [1019f520] + JLFzf v0.1.5
  [692b3bcd] + JLLWrappers v1.4.1
  [682c06a0] + JSON v0.21.3
  [b964fa9f] + LaTeXStrings v1.3.0
  [23fbe1c1] + Latexify v0.15.17
  [2ab3a3ac] + LogExpFunctions v0.3.19
  [e6f89c97] + LoggingExtras v1.0.0
  [1914dd2f] + MacroTools v0.5.10
  [739be429] + MbedTLS v1.1.7
  [442fdcdd] + Measures v0.3.2
  [e1d29d7a] + Missings v1.1.0
  [77ba4419] + NaNMath v1.0.1
  [4d8831e6] + OpenSSL v1.3.2
  [bac558e1] + OrderedCollections v1.4.1
  [69de0a69] + Parsers v2.5.2
  [b98c9c47] + Pipe v1.3.0
  [ccf2f8ad] + PlotThemes v3.1.0
  [995b91a9] + PlotUtils v1.3.2
  [91a5bcdd] + Plots v1.38.1
  [21216c6a] + Preferences v1.3.0
  [3cdcf5f2] + RecipesBase v1.3.2
  [01d81517] + RecipesPipeline v0.6.11
  [189a3867] + Reexport v1.2.2
  [05181044] + RelocatableFolders v1.0.0
  [ae029012] + Requires v1.3.0
  [6c6a2e73] + Scratch v1.1.1
  [992d4aef] + Showoff v1.0.3
  [777ac1f9] + SimpleBufferStream v1.1.0
  [66db9d55] + SnoopPrecompile v1.0.1
  [a2af1166] + SortingAlgorithms v1.1.0
  [276daf66] + SpecialFunctions v2.1.7
  [82ae8749] + StatsAPI v1.5.0
  [2913bbd2] + StatsBase v0.33.21
  [62fd8b95] + TensorCore v0.1.1
  [3bb67fe8] + TranscodingStreams v0.9.10
  [5c2747f8] + URIs v1.4.1
  [1cfade01] + UnicodeFun v0.4.1
  [41fe7b60] + Unzip v0.2.0
  [6e34b625] + Bzip2_jll v1.0.8+0
  [83423d85] + Cairo_jll v1.16.1+1
  [2e619515] + Expat_jll v2.4.8+0
  [b22a6f82] + FFMPEG_jll v4.4.2+2
  [a3f928ae] + Fontconfig_jll v2.13.93+0
  [d7e528f0] + FreeType2_jll v2.10.4+0
  [559328eb] + FriBidi_jll v1.0.10+0
  [0656b61e] + GLFW_jll v3.3.8+0
  [d2c73de3] + GR_jll v0.71.3+0
  [78b55507] + Gettext_jll v0.21.0+0
  [7746bdde] + Glib_jll v2.74.0+2
  [3b182d85] + Graphite2_jll v1.3.14+0
  [2e76f6c2] + HarfBuzz_jll v2.8.1+1
  [aacddb02] + JpegTurbo_jll v2.1.2+0
  [c1c5ebd0] + LAME_jll v3.100.1+0
  [88015f11] + LERC_jll v3.0.0+1
  [dd4b983a] + LZO_jll v2.10.1+0
βŒ… [e9f186c6] + Libffi_jll v3.2.2+1
  [d4300ac3] + Libgcrypt_jll v1.8.7+0
  [7e76a0d4] + Libglvnd_jll v1.6.0+0
  [7add5ba3] + Libgpg_error_jll v1.42.0+0
  [94ce4f54] + Libiconv_jll v1.16.1+2
  [4b2f31a3] + Libmount_jll v2.35.0+0
  [89763e89] + Libtiff_jll v4.4.0+0
  [38a345b3] + Libuuid_jll v2.36.0+0
  [e7412a2a] + Ogg_jll v1.3.5+1
  [458c3c95] + OpenSSL_jll v1.1.19+0
  [efe28fd5] + OpenSpecFun_jll v0.5.5+0
  [91d4177d] + Opus_jll v1.3.2+0
  [30392449] + Pixman_jll v0.40.1+0
  [ea2cea3b] + Qt5Base_jll v5.15.3+2
  [a2964d1f] + Wayland_jll v1.21.0+0
  [2381bf8a] + Wayland_protocols_jll v1.25.0+0
  [02c8fc9c] + XML2_jll v2.10.3+0
  [aed1982a] + XSLT_jll v1.1.34+0
  [4f6342f7] + Xorg_libX11_jll v1.6.9+4
  [0c0b7dd1] + Xorg_libXau_jll v1.0.9+4
  [935fb764] + Xorg_libXcursor_jll v1.2.0+4
  [a3789734] + Xorg_libXdmcp_jll v1.1.3+4
  [1082639a] + Xorg_libXext_jll v1.3.4+4
  [d091e8ba] + Xorg_libXfixes_jll v5.0.3+4
  [a51aa0fd] + Xorg_libXi_jll v1.7.10+4
  [d1454406] + Xorg_libXinerama_jll v1.1.4+4
  [ec84b674] + Xorg_libXrandr_jll v1.5.2+4
  [ea2f1a96] + Xorg_libXrender_jll v0.9.10+4
  [14d82f49] + Xorg_libpthread_stubs_jll v0.1.0+3
  [c7cfdc94] + Xorg_libxcb_jll v1.13.0+3
  [cc61e674] + Xorg_libxkbfile_jll v1.1.0+4
  [12413925] + Xorg_xcb_util_image_jll v0.4.0+1
  [2def613f] + Xorg_xcb_util_jll v0.4.0+1
  [975044d2] + Xorg_xcb_util_keysyms_jll v0.4.0+1
  [0d47668e] + Xorg_xcb_util_renderutil_jll v0.3.9+1
  [c22f9ab0] + Xorg_xcb_util_wm_jll v0.4.1+1
  [35661453] + Xorg_xkbcomp_jll v1.4.2+4
  [33bec58e] + Xorg_xkeyboard_config_jll v2.27.0+4
  [c5fb5394] + Xorg_xtrans_jll v1.4.0+3
  [3161d3a3] + Zstd_jll v1.5.2+0
βŒ… [214eeab7] + fzf_jll v0.29.0+0
  [a4ae2306] + libaom_jll v3.4.0+0
  [0ac62f75] + libass_jll v0.15.1+0
  [f638f0a6] + libfdk_aac_jll v2.0.2+0
  [b53b4c65] + libpng_jll v1.6.38+0
  [f27f6e37] + libvorbis_jll v1.3.7+1
  [1270edf5] + x264_jll v2021.5.5+0
  [dfaa095f] + x265_jll v3.5.0+0
  [d8fb68d0] + xkbcommon_jll v1.4.1+0
  [0dad84c5] + ArgTools v1.1.1
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching
  [b77e0a4c] + InteractiveUtils
  [b27032c2] + LibCURL v0.6.3
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.9.0
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics v1.9.0
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [e66e0078] + CompilerSupportLibraries_jll v1.0.2+0
  [deac9b47] + LibCURL_jll v7.84.0+0
  [29816b5a] + LibSSH2_jll v1.10.2+0
  [c8ffd9c3] + MbedTLS_jll v2.28.0+0
  [14a3606d] + MozillaCACerts_jll v2022.10.11
  [4536629a] + OpenBLAS_jll v0.3.21+0
  [05823500] + OpenLibm_jll v0.8.1+0
  [efcefdf7] + PCRE2_jll v10.42.0+0
  [bea87d4a] + SuiteSparse_jll v5.10.1+0
  [83775a58] + Zlib_jll v1.2.13+0
  [8e850b90] + libblastrampoline_jll v5.2.0+0
  [8e850ede] + nghttp2_jll v1.48.0+0
  [3f19e933] + p7zip_jll v17.4.0+0
        Info Packages marked with βŒ… have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
Precompiling environment...
  134 dependencies successfully precompiled in 62 seconds
Julia Version 1.10.0-DEV.305
Commit 9647a58169* (2023-01-07 06:29 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin21.6.0)
  CPU: 8 Γ— Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
  Threads: 1 on 4 virtual cores
Environment:
  JULIA_PKG_USE_CLI_GIT = true
  JULIA_PKG_SERVER_REGISTRY_PREFERENCE = eager
 66.368545 seconds (11.51 M allocations: 813.572 MiB, 0.37% gc time, 0.68% compilation time)

For me it’s closer to 1 minute, than 10-15 minutes, almost all spent in precompiling the package. Note that I had to change your script to add using InteractiveUtils before versioninfo().

If I don’t include precompilation time:

% ./julia --startup-file=no --project=/tmp -q
julia> @time @eval using Plots
       @time @eval display(plot(rand(10)))
  1.857742 seconds (5.56 M allocations: 348.100 MiB, 7.54% gc time, 0.33% compilation time)
  0.337435 seconds (72.09 k allocations: 4.168 MiB)
1 Like

@kristoffer.carlsson Will I need to make a new sysimg for every Julia version?/Is this compatible with juliaup?
@giordano Would you paste the exact contents of foo.jl so I can compare?

Your test script plus

First of all, I find your graph misleading.

Secondly, the output on 1.8.4 says

13 dependencies successfully precompiled in 508 seconds. 132 already precompiled.

Looks like you hadn’t cleaned the compile cache there, but did on e.g. 1.9

133 dependencies successfully precompiled in 922 seconds. 1 already precompiled.

For what it’s worth, I’m clocking in at ~4 minutes (on a seven year old CPU)

Julia Version 1.9.0-beta2
Commit 7daffeecb8 (2022-12-29 07:45 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 4 Γ— Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 1 on 4 virtual cores
225.820180 seconds (14.56 M allocations: 1016.985 MiB, 0.19% gc time, 2.81% compilation time: 50% of which was recompilation)

These are the actual times I would experience as a user if I wanted to plot something this morning. I didn’t do any intentional cache clearing ahead of time. 1.8.4 is faster because I have previously plotted things in that Julia version.

It’s still an unfair comparison between versions, because it gives the impression of a major performance regression from 1.8->1.9.

So your grievance is the absolute time in the order of ~10 minutes to first plot. And I agree, that is a pretty terrible user experience, but you are severly burdened by a very weak CPU here. I cannot speak to what is possible to improve precompilation times in the future, but I would say we’ve seen some pretty impressive improvements in TTFx in some packages lately.

you are severly burdened by a very weak CPU here.

I’m using a 2019 1.6 GHz Dual-Core Intel Core i5 processor with 8GB of ram and an Intel UHD Graphics 617 1536 MB embedded GPU.

While that CPU is certainly weak, not having a good workflow for such a device when Python and R and Matlab are a joy to work with for homework problems on weak hardware is certainly not good for the future of Julia [1]. At this point I avoid using julia on my laptop which was considered top-of-the-line 13-inch laptop in 2019.

Going back to suggested workarounds, does the following sound reasonable: (1) spending half an hour or more per julia version to compile Plots and the rest of the β€œinfrastructure” packages into a sysimg (2) prepping a home-grown script so you have a sysimg for each version of julia you care about (as it is not yet supported by juliaup or vscode) (3) getting into the habit of running some interactive work at lower optimization level so that latency is lower.

One thing that I wish I was able to do more easily is installing a package without having other packages be updated and then precompiled. Some Pkg magic probably will help with that, but I do not know enough about it. Suggestions would be welcomed.

[1]: I do not want my students to get burned by julia because they are setting it up on weak computers, when these same computers install and run numpy just fine.

7 Likes

Update for folks who got lower runtimes when trying to reproduce my results; julia-vscode takes a lot of memory on my computer. I tried again on 1.10 after clearing my cache with rm -r ~/.julia/compiled/v1.10 after quitting VSCode and got 260.799514s (4 minutes), which brings me down into the realm of what y’all are reporting.

2 Likes

This looks like you could really benefit from switching to low-latency plotting tools (Gnuplot, PlotlyLight).

What I do not understand is, why do you include this in your timing:

    import Pkg
    Pkg.activate(;temp=true)
    Pkg.add("Plots")

You do this once when first installing Plots. Of course you can do it again if you want to update the Plots package, but there is no reason to do that often.

For me the TTFP for Julia 1.8.4 is about 12 s and for 1.9-beta2 about 3.3s using a 5 year old desktop CPU. You should use a persistant user project for your work as explained here: Working with Julia projects | Julia programming notes

If you put the currently installed version of Plots.jl in the compat section of your project, e.g.

[compat]
Plots = "~1.38.1"

the version will not get updated when installing other packages unless you want to have an update.

7 Likes

Fully agree with this (though my experience with a laptop similar to yours (with 32 GB RAM and 1 TB disk) does not seems to be the same).

I have called the attention time to time that Julia and its packages takes an absurd disk space, which is a serious problem in laptops but I got the impression to be an alien when bringing up these issues. And this got worst with the precompiling cache as some DLLs are huge (Makie is ~140 MB, GMT 65 MB, etc) and have lots of zero bytes in them.

9 Likes

IIUC it will still re-precompile any time any of its 78 direct and indirect dependencies gets an update unless I pin all 79 of them.

I currently use different projects depending on what I am doing with Julia. Which project should I put this in?

1 Like

In all of the projects that need plotting.

Alternatively, when adding packages you can use the command:

pkg> add --preserve=all <package-to-add>

This command just adds the new package, but does NOT update any existing packages.

4 Likes

This feels like more work, higher latency, and lower reliability than @kristoffer.carlsson’s solution.

Every time I add Plots to a new project it may need to reprecompile if any of its deps are at different versions between the two projects. For your second option I still have that same problem and in addition, if I ever install a package using the β€œpackage not installed” prompt or forget --preserve=all when explicitly adding a package julia may hang for 5-15 minutes.

@PetrKryslUCSD, PlotlyLight has quite a reasonable TTFP! Thanks for sharing. It’s slower than Python but still workable. Perhaps more importantly, it has many fewer dependencies so it will presumably reprecompile less often.

Thanks for calling out --preserve=all. This would be an incredible quality-of-life improvement for me.

Just like @Lilith, I also frequently need to test things with different versions of julia in different environments and there is an enormous amount of spurious precompilement being triggered. For this use case, the decision to include precompiling in the @time seems quite reasonable. This is a dev latency issue, not a user latency issue.

1 Like

Try

import Pkg
Pkg.activate(temp=true)
Pkg.UPDATED_REGISTRY_THIS_SESSION[] = true
Pkg.add("Package1")
Pkg.add("Package2")

# Here is where it should really start
using Package1
using Package2

I actually had that for a while in my startup file.

Take a look at: GitHub - feanor12/Draft.jl: A small package to automatically create temporary environments in offline mode.

And a discussion about something similar is here: Speculations about the default environment (or a new draft environment)

Although I must say that for me those issues got less important now, but probably because I’m not currently dependent on a package with very large ttfx. Plots for me takes 15 s, and a second now with 1.9. My hardware is not much different from yours.

2 Likes

Making a sysimg is taking 2 and a half hours and counting so I’m starting to explore other possibilities. Would making a plotting environment with only Plots.jl in it and then using this workflow be sensible?

]activate SortingAlgorithms
...tweak an algorithm...
...get performance data I want to plot...
]activate @Plots
using Plots
]activate SortingAlgorithms
plot(data)

IIUC it is technically possible to get to a situation with known incompatible package versions with this, but I’m optimistic that that wouldn’t happen in practice.