Skip to content

refactor: improve new array-form codegen - #5157

Open
AayushSabharwal wants to merge 6 commits into
masterfrom
as/fix-array-codegen
Open

AayushSabharwal wants to merge 6 commits into
masterfrom
as/fix-array-codegen

Conversation

@AayushSabharwal

Copy link
Copy Markdown
Member

Minor performance changes

@github-actions

github-actions Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia vlts)

Time benchmarks
master 56b2b30... master / 56b2b30...
ODEProblem 6.42 ± 0.33 ms 6.83 ± 0.31 ms 0.94 ± 0.064
init 0.113 ± 0.03 ms 0.116 ± 0.033 ms 0.975 ± 0.38
large_parameter_init/ODEProblem 19.5 ± 1.9 ms 21.5 ± 0.91 ms 0.911 ± 0.095
large_parameter_init/init 0.11 ± 0.029 ms 0.111 ± 0.033 ms 0.987 ± 0.39
mtkcompile 11.1 ± 0.71 ms 12.1 ± 0.51 ms 0.913 ± 0.07
sparse_analytical_jacobian/ODEProblem 24 ± 1.2 ms 25.6 ± 0.92 ms 0.936 ± 0.056
sparse_analytical_jacobian/f_iip 0.071 ± 0.01 μs 0.07 ± 0 μs 1.01 ± 0.14
sparse_analytical_jacobian/f_oop 0.377 ± 0.011 ms 0.378 ± 0.012 ms 0.998 ± 0.043
time_to_load 7.74 ± 0.089 s 7.81 ± 0.011 s 0.991 ± 0.011
Memory benchmarks
master 56b2b30... master / 56b2b30...
ODEProblem 0.0375 M allocs: 1.95 MB 0.0375 M allocs: 1.96 MB 0.992
init 0.5 k allocs: 0.0843 MB 0.5 k allocs: 0.0843 MB 1
large_parameter_init/ODEProblem 0.161 M allocs: 6.06 MB 0.161 M allocs: 6.06 MB 1
large_parameter_init/init 0.632 k allocs: 0.178 MB 0.632 k allocs: 0.178 MB 1
mtkcompile 0.0594 M allocs: 3.38 MB 0.0594 M allocs: 3.38 MB 1
sparse_analytical_jacobian/ODEProblem 0.118 M allocs: 5.74 MB 0.118 M allocs: 5.74 MB 1
sparse_analytical_jacobian/f_iip 0 allocs: 0 B 0 allocs: 0 B
sparse_analytical_jacobian/f_oop 0.634 k allocs: 19.6 kB 0.634 k allocs: 19.6 kB 1
time_to_load 0.153 k allocs: 14.5 kB 0.153 k allocs: 14.5 kB 1

@github-actions

github-actions Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia v1)

Time benchmarks
master 56b2b30... master / 56b2b30...
ODEProblem 5.18 ± 0.26 ms 5.31 ± 0.37 ms 0.975 ± 0.085
init 0.133 ± 0.022 ms 0.132 ± 0.022 ms 1 ± 0.24
large_parameter_init/ODEProblem 14.7 ± 0.76 ms 14.8 ± 1.2 ms 0.992 ± 0.097
large_parameter_init/init 0.141 ± 0.04 ms 0.14 ± 0.04 ms 1.01 ± 0.41
mtkcompile 8.83 ± 0.8 ms 8.96 ± 0.82 ms 0.986 ± 0.13
sparse_analytical_jacobian/ODEProblem 19.8 ± 2.2 ms 19.6 ± 1.5 ms 1.01 ± 0.14
sparse_analytical_jacobian/f_iip 0.06 ± 0.01 μs 0.07 ± 0.001 μs 0.857 ± 0.14
sparse_analytical_jacobian/f_oop 0.108 ± 0.013 ms 0.108 ± 0.012 ms 1 ± 0.16
time_to_load 5.17 ± 0.034 s 5.29 ± 0.025 s 0.978 ± 0.0079
Memory benchmarks
master 56b2b30... master / 56b2b30...
ODEProblem 0.0377 M allocs: 1.73 MB 0.0377 M allocs: 1.73 MB 1
init 0.472 k allocs: 0.0602 MB 0.472 k allocs: 0.0602 MB 1
large_parameter_init/ODEProblem 0.157 M allocs: 5.39 MB 0.157 M allocs: 5.39 MB 1
large_parameter_init/init 0.754 k allocs: 0.166 MB 0.754 k allocs: 0.166 MB 1
mtkcompile 0.0557 M allocs: 2.62 MB 0.0557 M allocs: 2.62 MB 1
sparse_analytical_jacobian/ODEProblem 0.118 M allocs: 4.8 MB 0.118 M allocs: 4.8 MB 1
sparse_analytical_jacobian/f_iip 0 allocs: 0 B 0 allocs: 0 B
sparse_analytical_jacobian/f_oop 0.848 k allocs: 27 kB 0.848 k allocs: 27 kB 1
time_to_load 0.201 k allocs: 11.8 kB 0.201 k allocs: 11.8 kB 1

@AayushSabharwal
AayushSabharwal force-pushed the as/fix-array-codegen branch 3 times, most recently from 1e2b130 to 56b2b30 Compare September 22, 2026 13:56
AayushSabharwal and others added 6 commits September 23, 2026 15:19
Precaution for type-stability. Naming the closure also makes future
stacktraces more readable.
The removed comment is nonsensical
Also improves `NonlinearSystem(::System)` performance
`steady_state_initialization_eqs` still built `subrules` as
`Dict{SymbolicT, Float64}`, which `IRSubstituter` rejects: it requires
`AbstractDict{SymbolicT, SymbolicT}`.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant