Skip to content

Commit

Permalink
Merge pull request #97 from PALEOtoolkit/startup_time_fix
Browse files Browse the repository at this point in the history
Improve slow startup with large reaction networks
  • Loading branch information
sjdaines committed Aug 7, 2023
2 parents 1a91984 + de15324 commit af3f1c1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,14 @@ function add_arrays_data!(
return nothing
end

struct DispatchMethodLists
list_initialize # not typed to avoid specializing large Tuples
list_do # not typed to avoid specializing large Tuples
end

"""
create_dispatch_methodlists(model::Model, modeldata::AbstractModelData, arrays_idx::Int, cellranges; kwargs)
-> (;list_initialize, list_do)
-> DispatchMethodLists(list_initialize, list_do)
Compile lists of `initialize` and `do` methods + corresponding `cellrange` for main loop [`do_deriv`](@ref).
Expand Down Expand Up @@ -605,8 +610,8 @@ function create_dispatch_methodlists(
cellranges,
generated_dispatch,
)
return (;list_initialize, list_do)

DispatchMethodLists(list_initialize, list_do)
end


Expand Down

0 comments on commit af3f1c1

Please sign in to comment.