If you use NonlinearSolve.jl there are a couple of options:
- Use SimpleNonlinearSolve Code Optimization for Small Nonlinear Systems in Julia · NonlinearSolve.jl that will pretty much outperform most solvers for scalar/static arrays problems
- Use the caching interface of
cache = init(....)
and inside the loop first doreinit!(cache; p = <bla, bla, bla>)
and thensolve!(cache)