Skip to content

Invalidation of nameof #1399

@oxinabox

Description

@oxinabox

So I was going through with SnoopCompile trying to workout why even with a precompilation script i was still seeing 90+% of my time spent on recompilation.

Seems like Catalyst does a lot of invalidations.
the following seems reasonable to fix:

julia> trees[end-1]
inserting nameof(lrs::Catalyst.LatticeReactionSystem) @ Catalyst ~/.julia/packages/Catalyst/DMVHG/src/spatial_reaction_systems/lattice_reaction_systems.jl:484 invalidated:
   backedges: 1: superseding nameof(sys::ModelingToolkit.AbstractSystem) @ ModelingToolkit ~/.julia/packages/ModelingToolkit/aiAqm/src/systems/abstractsystem.jl:218 with MethodInstance for nameof(::ModelingToolkit.AbstractSystem) (2093 children)

This is the single biggest invalidation,
and it could be fixed by not overloading this,
and instead just setting the name field during construction.
https://github.com/SciML/ModelingToolkit.jl/blob/279ec69a3dc5ffaaa3660448361c07dd9783b3c7/lib/ModelingToolkitBase/src/systems/abstractsystem.jl#L83

Most of the others i suspect will be fixed by getting on to the lastest verson of MTK and SymbolicUtils.jl

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions