Skip to content

Commit d532cab

Browse files
ci: add benchmark for large parameter initialization model
1 parent cf33682 commit d532cab

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

benchmark/benchmarks.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,19 @@ SUITE["ODEProblem"] = @benchmarkable ODEProblem($model, $u0, $tspan)
5959
# first call
6060
init(prob)
6161
SUITE["init"] = @benchmarkable init($prob)
62+
63+
large_param_init = SUITE["large_parameter_init"] = BenchmarkGroup()
64+
65+
N = 50
66+
@variables x(t)[1:N]
67+
@parameters A[1:N, 1:N]
68+
69+
defval = collect(x) * collect(x)'
70+
@mtkcompile model = System(
71+
[D(x) ~ A * x], t; defaults = [A => defval], guesses = [A => fill(NaN, N, N)])
72+
73+
u0 = [x => rand(N)]
74+
prob = ODEProblem(model, u0, tspan)
75+
large_param_init["ODEProblem"] = @benchmarkable ODEProblem($model, $u0, $tspan)
76+
77+
large_param_init["init"] = @benchmarkable init($prob)

0 commit comments

Comments
 (0)