-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Pkg3 stdlib #26141
Pkg3 stdlib #26141
Conversation
Internalizing packages was necessary to avoid a conflict between the versions of TOML and TerminalMenus loaded by Pkg3 and thus precompiled during Pkg3 loading and precompilation after Pkg3 is already loaded.
when user does `pkg> status` in a non-git-tracked environment, print a clear error message instead of a erroring on a Void env.git field (#4).
few fixes noticed when bringing Pkg3 into stdlib
1b2035b
to
2f0db6d
Compare
So a bit of an update here. The good news. This branch passes tests and incorporates the new package manager. It is fast and awesome. In order for Pkg3 to be pleasant to use it requires precompile statements. As an example, the current branch has the following timings, calling two different function twice (the string in the called function is equivalent to entering it in the Pkg3 REPL mode): julia> @time Pkg3.REPLMode.do_cmd(Base.active_repl, "st")
...
0.529426 seconds (560.79 k allocations: 31.929 MiB, 1.22% gc time)
julia> @time Pkg3.REPLMode.do_cmd(Base.active_repl, "st")
...
0.005712 seconds (10.55 k allocations: 739.734 KiB)
julia> @time Pkg3.REPLMode.do_cmd(Base.active_repl, "add JSON")
...
1.568578 seconds (1.89 M allocations: 110.119 MiB, 2.22% gc time)
julia> @time Pkg3.REPLMode.do_cmd(Base.active_repl, "add JSON")
...
0.113276 seconds (498.01 k allocations: 29.760 MiB, 5.69% gc time) So the first time is slower, but the absolute time is such that, for an interactive package, it is pretty ok. Removing all the precompile statements, we instead have: julia> @time Pkg3.REPLMode.do_cmd(Base.active_repl, "st")
...
5.919937 seconds (6.83 M allocations: 392.043 MiB, 3.08% gc time)
julia> @time Pkg3.REPLMode.do_cmd(Base.active_repl, "st")
...
0.005653 seconds (10.61 k allocations: 806.234 KiB)
julia> @time Pkg3.REPLMode.do_cmd(Base.active_repl, "add JSON")
...
17.872648 seconds (16.79 M allocations: 933.106 MiB, 3.47% gc time)
julia> @time Pkg3.REPLMode.do_cmd(Base.active_repl, "add JSON")
...
0.145271 seconds (498.02 k allocations: 29.745 MiB, 7.76% gc time) The time for both first calls went up by a factor of 10 and, in fact, Pkg3.add is almost the same speed as the current one.
Without precompile:
With precompile:
I am quite surprised that the effect of the precompile statements is so large. Pkg3 is about 6k lines of pretty normal Julia code (no generated function or excessive codegen). Anyway, some possible ways forward:
Comments / opinions welcome. |
I agree that I would like to understand the OOM situation better, is Julia really using more than 4Gigs of memory during the compilation step? Have you tried turning on: Line 159 in 9f8bdf4
The last build on i686 Linux seemed to time out https://travis-ci.org/JuliaLang/julia/jobs/344988033 OT: Can we move TOML to be it's own independent stdlib project? |
Ultimately, yes, but for now we don't want to commit to it being official. It works fine as an internal part of Pkg3 but needs quite a bit of work as a general TOML parsing library. |
I looked at activity monitor and it used max about 2.8-ish GB on my Mac. I thought 32 bit systems was limited to 2 GB. The OOM error is thrown when the PassManager is running in this function here: https://github.com/JuliaLang/julia/blob/master/src/jitlayers.cpp#L1060.
Most likely, but let's have that discussion later imo. It is not what is urgent right now. |
Travis has a memory limit of about 4G and 32bit OSs are limited to slightly less than 4G. I just build it and I peaked out at around 3.4-3.7G of RES (memory resident in RAM) |
Here is a backtrace: https://travis-ci.org/JuliaLang/julia/jobs/344688295#L1974-L2013 |
Maximum resident set size (kbytes): 3625240
|
Obviously any improvements in compile time/footprint are great, but I'd vote for disabling precompile on low memory systems for the moment and get this in. |
Ok, so I did the following. Disabled Pkg3 precompile statements by default. At first command, print a small warning that Pkg3 precompile is off and that first call is known to be slow. It also says how to build julia with precompile statements on (set an env flag and rebuild) which will disable the warning. The warning can also be disabled by another env flag. I think this is best for now. Get Pkg3 into stdlib so we can start working with it, it can optionally be fast by rebuilding, and people will at least see that there is a reason for it to be slow if they run it without precompile statements. |
11fa379
to
e900736
Compare
e900736
to
d86d27e
Compare
d86d27e
to
41ce00e
Compare
What do I need to do to transition my julia-master to use Pkg3? |
Build Julia and type |
The |
Let's see if this passes CI.