Skip to content

Commit 6f957b2

Browse files
committed
Add more precompilation statements
This lowers the time for `addprocs(1)` from ~3.1s to ~1.8s on Julia 1.12.
1 parent f679c39 commit 6f957b2

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/precompile.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ precompile(Tuple{typeof(DistributedNext.procs)})
33
precompile(Tuple{typeof(DistributedNext.finalize_ref), DistributedNext.Future})
44
precompile(Tuple{typeof(DistributedNext.setup_launched_worker), DistributedNext.LocalManager, DistributedNext.WorkerConfig, Vector{Int}})
55
precompile(Tuple{typeof(DistributedNext.process_tcp_streams), Sockets.TCPSocket, Sockets.TCPSocket, Bool})
6+
precompile(Tuple{typeof(Serialization.serialize), DistributedNext.ClusterSerializer{Sockets.TCPSocket}, Array{Any, 1}})
7+
precompile(Tuple{typeof(DistributedNext.parse_connection_info), String})
8+
precompile(Tuple{typeof(DistributedNext._run_callbacks_concurrently), String, Base.Dict{Any, Union{Function, Type}}, Int64, Array{Tuple{DistributedNext.LocalManager, Base.Dict{Symbol, Any}}, 1}})
9+
precompile(Tuple{typeof(DistributedNext._run_callbacks_concurrently), String, Base.Dict{Any, Union{Function, Type}}, Int64, Array{Int64, 1}})
10+
precompile(Tuple{typeof(DistributedNext.read_worker_host_port), Base.PipeEndpoint})
11+
precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, Int64})
12+
precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, WeakRef})
613

714
precompile(Tuple{typeof(DistributedNext.handle_msg), DistributedNext.IdentifySocketMsg, DistributedNext.MsgHeader, Sockets.TCPSocket, Sockets.TCPSocket, VersionNumber})
815
precompile(Tuple{typeof(DistributedNext.handle_msg), DistributedNext.CallWaitMsg, DistributedNext.MsgHeader, Sockets.TCPSocket, Sockets.TCPSocket, VersionNumber})
@@ -14,6 +21,12 @@ precompile(Tuple{typeof(DistributedNext.handle_msg), DistributedNext.RemoteDoMsg
1421
precompile(Tuple{typeof(DistributedNext.handle_msg), DistributedNext.JoinPGRPMsg, DistributedNext.MsgHeader, Sockets.TCPSocket, Sockets.TCPSocket, VersionNumber})
1522
precompile(Tuple{typeof(DistributedNext.handle_msg), DistributedNext.JoinCompleteMsg, DistributedNext.MsgHeader, Sockets.TCPSocket, Sockets.TCPSocket, VersionNumber})
1623

24+
# These lines were obtained from `addprocs(1; exeflags=`--trace-compile=compilation.txt --trace-compile-timing`)`
25+
precompile(Tuple{typeof(DistributedNext.start_worker)})
26+
precompile(Tuple{typeof(DistributedNext.start_worker), Base.PipeEndpoint, String})
27+
precompile(Tuple{typeof(DistributedNext.set_valid_processes), Array{Int64, 1}})
28+
precompile(Tuple{typeof(DistributedNext.terminate_all_workers)})
29+
1730
# This is disabled because it doesn't give much benefit
1831
# and the code in Distributed is poorly typed causing many invalidations
1932
# TODO: Maybe reenable now that Distributed is not in sysimage.

0 commit comments

Comments
 (0)