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

Precompile REPLMode.repl_init, add force_compile #3711

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mkitti
Copy link
Contributor

@mkitti mkitti commented Nov 28, 2023

Adds some precompilation for Pkg.REPLMode.repl_init

Removes direct reference to Base.active_repl

Add Base.Experimental.@force_compile

@mkitti
Copy link
Contributor Author

mkitti commented Nov 28, 2023

Before

julia> @time_imports using Pkg
      0.6 ms  Printf
     37.1 ms  Dates
      0.5 ms  TOML
               ┌ 0.0 ms NetworkOptions.__init__() 
     40.8 ms  NetworkOptions 81.56% compilation time
               ┌ 0.4 ms MbedTLS_jll.__init__() 
      0.8 ms  MbedTLS_jll
               ┌ 0.2 ms LibSSH2_jll.__init__() 
      0.4 ms  LibSSH2_jll
               ┌ 0.2 ms LibGit2_jll.__init__() 
      0.4 ms  LibGit2_jll
     13.4 ms  LibGit2
     17.7 ms  ArgTools
               ┌ 0.1 ms nghttp2_jll.__init__() 
      0.5 ms  nghttp2_jll
               ┌ 0.2 ms LibCURL_jll.__init__() 
      0.4 ms  LibCURL_jll
               ┌ 6.8 ms MozillaCACerts_jll.__init__() 98.61% compilation time
      7.2 ms  MozillaCACerts_jll 93.41% compilation time
               ┌ 0.0 ms LibCURL.__init__() 
      2.2 ms  LibCURL
               ┌ 0.2 ms Downloads.Curl.__init__() 
     32.0 ms  Downloads
      1.1 ms  Tar
               ┌ 23.4 ms p7zip_jll.__init__() 99.32% compilation time
     23.7 ms  p7zip_jll 97.87% compilation time
      0.3 ms  UUIDs
               ┌ 0.0 ms Logging.__init__() 
      0.7 ms  Logging
      1.1 ms  Serialization
               ┌ 0.0 ms Pkg.REPLMode.__init__() 
               ├ 55.5 ms Pkg.__init__() 97.88% compilation time
    678.9 ms  Pkg 8.00% compilation time

After this pull request

julia> @time_imports using Pkg
      0.6 ms  Printf
     35.7 ms  Dates
      0.5 ms  TOML
               ┌ 0.0 ms NetworkOptions.__init__() 
     38.0 ms  NetworkOptions 81.84% compilation time
               ┌ 0.4 ms MbedTLS_jll.__init__() 
      0.7 ms  MbedTLS_jll
               ┌ 0.1 ms LibSSH2_jll.__init__() 
      0.3 ms  LibSSH2_jll
               ┌ 0.2 ms LibGit2_jll.__init__() 
      0.4 ms  LibGit2_jll
     13.6 ms  LibGit2
     19.6 ms  ArgTools
               ┌ 0.1 ms nghttp2_jll.__init__() 
      0.5 ms  nghttp2_jll
               ┌ 0.2 ms LibCURL_jll.__init__() 
      0.4 ms  LibCURL_jll
               ┌ 6.2 ms MozillaCACerts_jll.__init__() 98.84% compilation time
      6.5 ms  MozillaCACerts_jll 94.66% compilation time
               ┌ 0.0 ms LibCURL.__init__() 
      1.6 ms  LibCURL
               ┌ 0.2 ms Downloads.Curl.__init__() 
     29.8 ms  Downloads
      1.1 ms  Tar
               ┌ 22.1 ms p7zip_jll.__init__() 99.36% compilation time
     22.5 ms  p7zip_jll 97.80% compilation time
      0.3 ms  UUIDs
               ┌ 0.0 ms Logging.__init__() 
      0.9 ms  Logging
      1.5 ms  Serialization
               ┌ 0.0 ms Pkg.REPLMode.__init__() 
               ├ 30.7 ms Pkg.__init__() 96.54% compilation time
    644.4 ms  Pkg 4.60% compilation time

@mkitti
Copy link
Contributor Author

mkitti commented Nov 28, 2023

CI failure on macOS is unrelated.

Username for 'https://github.com/': Username for 'https://github.com/': fatal: could not read Username for 'https://github.com/': terminal prompts disabled
fatal: could not read Username for 'https://github.com/': terminal prompts disabled
testing: Test Failed at /Users/runner/work/Pkg.jl/Pkg.jl/test/pkg.jl:244
  Expression: any(endswith(".cov"), readdir(pkgdir))

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.

None yet

1 participant