Time to build system and problem is slower in Julia 1.12 with MTKv11

Wen-Wei_Tseng
Mon, 09 Feb 2026 08:36:53 +0000
Performance

Hi, while I was trying the new version (v11) of ModelingToolkit.jl , I noticed it took longer to build the ODE system and problem under Julia 1.12.

Here is the GitHub actions workflow running the script

using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
using OrdinaryDiffEq

@parameters τ = 3.0 # parameters
@variables x(t) = 0.0 # dependent variables
eqs = [D(x) ~ (1 - x) / τ]

@time "Build system" @mtkcompile fol = System(eqs, t)
@time "Build problem" prob = ODEProblem(fol, [], (0.0, 10.0))
@time "Solve problem" sol = solve(prob, Tsit5())

Time for building the ODESystem / ODEProblem in seconds.

MTK | JL1.10 | JL1.12
v10 | 1.25/2.04 | 0.76/1.89
v11 | 1.91/1.35 | 33.44/17.37

Is there anything I can do to reduce the first time to build systems/problems in 1.12?

12 posts - 4 participants