Closed SouthEndMusic closed 3 months ago
Was your secondary goal to touch all Julia core files? 😅
AGV model went from:
2.030423 seconds (3.86 M allocations: 1006.978 MiB, 1.50% gc time)
to
1.934420 seconds (3.02 M allocations: 966.206 MiB, 1.83% gc time)
Given the reduction in allocations, this might be even faster on non-control heavy models.
I plowed trough some refactoring ideas:
NodeID
, which is used to avoid many lookupsFlowBoundary
outflow edges,DiscreteControl
controlled nodeslogic_mapping
perDiscreteControl
nodeDiscreteControl
read and write variables via refs. This neatly cleans up what was first partly node type specific and type unstable code. The source of truth for which parameters are controllable is now in the functioncontrollablefields
invalidation.jl
, which can also be used to automatically generate a table of controllable parameters in the docs