-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Distributed support a package extension
This shaves off ~180ms from loading, though it does require Julia 1.9+.
- Loading branch information
1 parent
fe4d02c
commit f43ecbf
Showing
3 changed files
with
15 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,18 @@ authors = ["Nicholas Bauer <[email protected]>"] | |
version = "0.2.3" | ||
|
||
[deps] | ||
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" | ||
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" | ||
|
||
[weakdeps] | ||
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" | ||
|
||
[extensions] | ||
DistributedExt = ["Distributed"] | ||
|
||
[compat] | ||
julia = "1.6" | ||
Distributed = "1" | ||
REPL = "1" | ||
julia = "1.9" | ||
|
||
[extras] | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
11 changes: 6 additions & 5 deletions
11
src/override-Distributed-process_messages.jl → ext/DistributedExt.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
__precompile__(false) | ||
module DistributedExt | ||
|
||
import Base: | ||
showerror | ||
__precompile__(false) | ||
|
||
import Distributed: | ||
myid, | ||
RemoteException | ||
|
||
# copied from Distributed/process_messages.jl and added dealing with RemoteException | ||
function showerror(io::IO, re::RemoteException) | ||
function Base.showerror(io::IO, re::RemoteException) | ||
(re.pid != myid()) && print(io, "On worker ", re.pid, ":\n") | ||
showerror(IOContext(io, :compacttrace => false), re.captured) | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters