Closed ChrisRackauckas closed 1 year ago
It is difficult to directly build julia functions from R functions in general. I see that modeling toolkit has a macro system. It should be okay to have a macro system in R (non-standard evaluation) and translate the R expression into DSLs in julia so build a julia function from a restricted set of R expressions.
That's what we're doing. The only issue is that calling
odesys = de$modelingtoolkitize(prob)
jul_f = de$ODEFunction(odesys)
which builds the Julia function has a lot of overhead, while just sending those pieces over and evaling has a lot less overhead. So building the same Julia function with the same Julia commands has no overhead if you eval it but has overhead if you call the functions directly through JuliaCall.
The JIT functions do this.
Notice how
modelingtoolkitize
still has overhead of the function is defined like this. @Non-Contradiction is there a way to directly build Julia functions from R without overhead? Until then, we'll be using this workaround viajitoptimize_ode
.