Running @snoop_invalidations on using PowerSimulations, I see the following:
inserting getproperty(::Type{FACTSOperationModes}, sym::Symbol) @ PowerSystems.FACTSOperationModesModule ~/Documents/julia/Sienna/psy5/InfrastructureSystems.jl/src/utils/utils.jl:370 invalidated:
backedges: 1: superseding getproperty(x::Type, f::Symbol) @ Base Base_compiler.jl:48 with MethodInstance for getproperty(::Type, ::Symbol) (1 children)
2: superseding getproperty(x::Type, f::Symbol) @ Base Base_compiler.jl:48 with MethodInstance for getproperty(::DataType, ::Symbol) (387 children)
[repeats once for every scoped enum definition]
That second child has 387 invalidations. And that happens for every ScopedEnum! I'll see if I can find a way to quantify the pre-compilation impact of this...but at the very least, this is bad.
If we simply replaced ACBusTypes.REF with ACBusTypes._name2value[:REF], then it'd go away. Still, it'd be nice to have some more concise syntax. Maybe we could make something like ACBusTypes(REF) work.
Running
@snoop_invalidationsonusing PowerSimulations, I see the following:That second child has 387 invalidations. And that happens for every
ScopedEnum! I'll see if I can find a way to quantify the pre-compilation impact of this...but at the very least, this is bad.If we simply replaced
ACBusTypes.REFwithACBusTypes._name2value[:REF], then it'd go away. Still, it'd be nice to have some more concise syntax. Maybe we could make something likeACBusTypes(REF)work.