I have a system with around 1500 equations. It takes a long time to run the following function, so I want to serialize and deserialize f_ip, dvs, psym and io_sys
so I can use them between sessions.
(_, f_ip), dvs, psym, io_sys = ModelingToolkit.generate_control_function(sys, inputs)
However, using deserialize("sys.bin")
takes 20 minutes. f_ip
is a runtime generated function and io_sys
is a modelingtoolkit ODESystem. dvs
and psym
are small objects. Most of the time of deserialization is used on f_ip
and io_sys
.
How can I speed up the deserialization significantly? Can I reduce the file size of the serialization, in order to speed up deserialization? Somehow, βsys.binβ ends up at almost 3GB in storage.
I tried using write
and include
as discussed here: Using Serialization to store then load a lambdified function? - #2 by SteffenPL
But this gave me a syntax error in the βsys.jlβ file:
#ββββββββββββββ ββ Expected ")"