-
Notifications
You must be signed in to change notification settings - Fork 134
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
Deserialization is too slow (for the wrong reasons) #4558
Comments
I had a quick look and it seems that diff --git a/src/Serialization/main.jl b/src/Serialization/main.jl
index fff1110bf73..ffd10fee676 100644
--- a/src/Serialization/main.jl
+++ b/src/Serialization/main.jl
@@ -242,15 +242,15 @@ function load_typed_object(s::DeserializerState; override_params::Any = nothing)
end
end
-function load_object(s::DeserializerState, T::Type, key::Union{Symbol, Int})
+function load_object(s::DeserializerState, T::Type{innerT}, key::Union{Symbol, Int}) where innerT
load_node(s, key) do _
- load_object(s, T)
+ load_object(s, T)::innerT
end
end
-function load_object(s::DeserializerState, T::Type, params::Any, key::Union{Symbol, Int})
+function load_object(s::DeserializerState, T::Type{innerT}, params::Any, key::Union{Symbol, Int}) where innerT
load_node(s, key) do _
- load_object(s, T, params)
+ load_object(s, T, params)::innerT
end
end But since there is a major overhaul in the works by @antonydellavecchia right now (see #4162), I would first wait for that and how it impacts performance, and then we can benchmark things like my patch again and include maybe something like this if it helps. |
#4162 does such a fix. |
Try:
this takes (the
load
) > 30 sec. If you profile theload
and look at the c-functions called, then >90% are spent in julia trying to figure out types. Less than 5% are json/ flint.The text was updated successfully, but these errors were encountered: