Conservative Package Compiler Results
- Using a ton of standard pervasive packages only helps 10%
- Getting DiffEqBase helps 50%
- Getting OrdinaryDiffEq without extra precompiles gets to 1.3 seconds, vs 0.6 seconds on the second run. That's pretty good!
using PackageCompiler | |
conservative = [ | |
:MacroTools | |
:MuladdMacro | |
:TimerOutputs | |
:ForwardDiff | |
:Plots | |
:Lazy | |
:StaticArrays | |
:BenchmarkTools | |
:Latexify | |
:Debugger | |
:Unitful | |
:IterativeSolvers | |
:Parameters | |
:Reexport | |
:NLsolve | |
:SpecialFunctions | |
:FiniteDiff | |
:SimpleTraits | |
:RecipesBase | |
:LabelledArrays | |
:AbstractFFTs | |
:UnPack | |
] | |
diffeqbase = [ | |
:DiffEqBase | |
] | |
ordinarydiffeq = [ | |
:OrdinaryDiffEq | |
] | |
PackageCompiler.create_sysimage(vcat(conservative,diffeqbase); | |
replace_default=true) | |
@time begin | |
using OrdinaryDiffEq | |
f(u,p,t) = 1.01*u | |
u0=1/2 | |
tspan = (0.0,1.0) | |
prob = ODEProblem(f,u0,tspan) | |
sol = solve(prob,Tsit5(),reltol=1e-8,abstol=1e-8) | |
end | |
# Before | |
10.289882 seconds (23.34 M allocations: 1.292 GiB, 4.54% gc time) | |
# After Conservative | |
9.634908 seconds (18.76 M allocations: 1.034 GiB, 4.11% gc time) | |
# After DiffEqBase | |
5.029686 seconds (8.19 M allocations: 439.332 MiB, 5.37% gc time) | |
# After OrdinaryDiffEq | |
1.310768 seconds (3.26 M allocations: 174.868 MiB, 10.44% gc time) |