Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start trying to precompile ModelingToolkit better #1215

Merged
merged 4 commits into from
Feb 1, 2022
Merged

Commits on Feb 1, 2022

  1. start trying to precompile ModelingToolkit better

    ```julia
    using ModelingToolkit, OrdinaryDiffEq
    
    function f()
          @parameters t σ ρ β
          @variables x(t) y(t) z(t)
          D = Differential(t)
    
          eqs = [D(D(x)) ~ σ*(y-x),
                 D(y) ~ x*(ρ-z)-y,
                 D(z) ~ x*y - β*z]
    
          @nAmed sys = ODESystem(eqs)
          sys = ode_order_lowering(sys)
    
          u0 = [D(x) => 2.0,
                x => 1.0,
                y => 0.0,
                z => 0.0]
    
          p  = [σ => 28.0,
                ρ => 10.0,
                β => 8/3]
    
          tspan = (0.0,100.0)
          prob = ODEProblem(sys,u0,tspan,p,jac=true)
    end
    
    using SnoopCompile
    
    tinf = @snoopi_deep f()
    ```
    
    ```julia
    Before:
    InferenceTimingNode: 8.138765/20.550152 on Core.Compiler.Timings.ROOT() with 821 direct children
    InferenceTimingNode: 8.152606/20.643050 on Core.Compiler.Timings.ROOT() with 821 direct children
    
    After:
    InferenceTimingNode: 8.216759/17.715817 on Core.Compiler.Timings.ROOT() with 839 direct children
    InferenceTimingNode: 8.272943/17.854555 on Core.Compiler.Timings.ROOT() with 840 direct children
    ```
    
    only 2 seconds for now, but it's a start.
    ChrisRackauckas committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    eec9252 View commit details
    Browse the repository at this point in the history
  2. Update precompile.jl

    ChrisRackauckas committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    3c45aea View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e12e97c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    33f1261 View commit details
    Browse the repository at this point in the history