Skip to content

Commit

Permalink
add some explicit precompile statements for Pkg.status. For some re…
Browse files Browse the repository at this point in the history
…ason, these don't seem to "take" on our precompile workload. (#4114)

Before:

```
julia> @time @eval Pkg.status()
0.470141 seconds (2.28 M allocations: 151.859 MiB, 2.91% gc time, 59.31% compilation time: 11% of which was recompilation)
```

After

```
julia> @time @eval Pkg.status()
  0.220179 seconds (1.69 M allocations: 122.680 MiB, 6.14% gc time, 25.84% compilation time: 74% of which was recompilation)
```

Co-authored-by: KristofferC <[email protected]>
  • Loading branch information
KristofferC and KristofferC authored Dec 16, 2024
1 parent e7c37f3 commit 47ad7e3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,29 @@ let
Base.precompile(Tuple{Type{Pkg.REPLMode.QString}, String, Bool})
Base.precompile(Tuple{typeof(Pkg.REPLMode.parse_package), Array{Pkg.REPLMode.QString, 1}, Base.Dict{Symbol, Any}})
Base.precompile(Tuple{Type{Pkg.REPLMode.Command}, Pkg.REPLMode.CommandSpec, Base.Dict{Symbol, Any}, Array{Pkg.Types.PackageSpec, 1}})

# Manually added from trace compiling Pkg.status.
Base.precompile(Tuple{typeof(Core.kwcall), NamedTuple{(:color,), Tuple{Symbol}}, typeof(Base.printstyled), Base.IOContext{Base.GenericIOBuffer{Memory{UInt8}}}, Char})
Base.precompile(Tuple{typeof(Base.join), Base.GenericIOBuffer{Memory{UInt8}}, Tuple{UInt64}, Char})
Base.precompile(Tuple{typeof(Base.empty), Base.Dict{Any, Any}, Type{String}, Type{Base.UUID}})
Base.precompile(Tuple{typeof(Base.join), Base.GenericIOBuffer{Memory{UInt8}}, Tuple{UInt32}, Char})
Base.precompile(Tuple{typeof(Base.unsafe_read), Base.PipeEndpoint, Ptr{UInt8}, UInt64})
Base.precompile(Tuple{typeof(Base.readbytes!), Base.PipeEndpoint, Array{UInt8, 1}, Int64})
Base.precompile(Tuple{typeof(Base.closewrite), Base.PipeEndpoint})
Base.precompile(Tuple{typeof(Base.convert), Type{Base.Dict{String, Union{Array{String, 1}, String}}}, Base.Dict{String, Any}})
Base.precompile(Tuple{typeof(Base.map), Function, Array{Any, 1}})
Base.precompile(Tuple{Type{Array{Dates.DateTime, 1}}, UndefInitializer, Tuple{Int64}})
Base.precompile(Tuple{typeof(Base.maximum), Array{Dates.DateTime, 1}})
Base.precompile(Tuple{Type{Pair{A, B} where B where A}, String, Dates.DateTime})
Base.precompile(Tuple{typeof(Base.map), Function, Array{Base.Dict{String, Dates.DateTime}, 1}})
Base.precompile(Tuple{typeof(TOML.Internals.Printer.is_array_of_tables), Array{Base.Dict{String, Dates.DateTime}, 1}})
Base.precompile(Tuple{typeof(Core.kwcall), NamedTuple{(:indent, :sorted, :by, :inline_tables), Tuple{Int64, Bool, typeof(Base.identity), Base.IdSet{Base.Dict{String, V} where V}}}, typeof(TOML.Internals.Printer.print_table), Nothing, Base.IOStream, Base.Dict{String, Dates.DateTime}, Array{String, 1}})
Base.precompile(Tuple{typeof(Base.deepcopy_internal), Base.Dict{String, Base.UUID}, Base.IdDict{Any, Any}})
Base.precompile(Tuple{typeof(Base.deepcopy_internal), Base.Dict{String, Union{Array{String, 1}, String}}, Base.IdDict{Any, Any}})
Base.precompile(Tuple{typeof(Base.deepcopy_internal), Base.Dict{String, Array{String, 1}}, Base.IdDict{Any, Any}})
Base.precompile(Tuple{typeof(Base.deepcopy_internal), Base.Dict{String, Base.Dict{String, String}}, Base.IdDict{Any, Any}})
Base.precompile(Tuple{typeof(Base.deepcopy_internal), Tuple{String}, Base.IdDict{Any, Any}})
Base.precompile(Tuple{Type{Memory{Pkg.Types.PackageSpec}}, UndefInitializer, Int64})
end
copy!(DEPOT_PATH, original_depot_path)
copy!(LOAD_PATH, original_load_path)
Expand Down

0 comments on commit 47ad7e3

Please sign in to comment.