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

REPLMode.jl: set compiler_options optimize = 1 #4015

Merged
merged 3 commits into from
Sep 22, 2024

Conversation

PallHaraldsson
Copy link
Contributor

@PallHaraldsson PallHaraldsson commented Sep 4, 2024

Fixes 3x PythonCall startup regression because of: JuliaPy/CondaPkg.jl#145 (at least least if backported to 1.11).

$ julia +1.11 --compile=min

julia> @time Pkg.REPLMode.gen_help()
  0.180643 seconds (91.88 k allocations: 2.218 MiB, 17.97% compilation time)

vs.
julia> @time Pkg.REPLMode.gen_help()
  2.129547 seconds (871.64 k allocations: 44.875 MiB, 5.32% gc time, 99.94% compilation time)

That one function slows down CondaPkg, and therefore also PythoCall, by that amount on 1.11

@PallHaraldsson
Copy link
Contributor Author

I think I can only selectively change opt for a module, not one function. That's the one I care about, do you think any of the others are speed-critical?

@KristofferC
Copy link
Sponsor Member

KristofferC commented Sep 9, 2024

What version are you on? This is for me:

julia> VERSION
v"1.11.0-rc3"

julia> using Pkg

julia> @time Pkg.REPLMode.gen_help()
  0.000287 seconds (2.50 k allocations: 134.836 KiB)
  Welcome to the Pkg REPL-mode. To return to the julia>
...

@PallHaraldsson
Copy link
Contributor Author

I was working on 1.11.0-rc3. Make sure to test in the REPL without ever opening the Pkg mode (or not in the REPL).

However, I'll likely abandon this (draft) and try to get Pkg faster, rather avoid depending on it.

@KristofferC
Copy link
Sponsor Member

The optimize=1 is most likely worth it. I am a bit worried about the infer=false because that can give a lot of invalidations.

@KristofferC KristofferC marked this pull request as ready for review September 20, 2024 12:40
@IanButterworth IanButterworth changed the title Update REPLMode.jl for faster startup REPLMode.jl: set compiler_options optimize = 1 Sep 22, 2024
@IanButterworth IanButterworth merged commit ef9f76c into JuliaLang:master Sep 22, 2024
7 checks passed
@PallHaraldsson PallHaraldsson deleted the patch-1 branch September 22, 2024 12:25
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.

3 participants