Currently VNV's num_inactive field is a Dict{Int,Int} (or before #1098 an OrderedDict{Int,Int}). As @penelopeysm noted in #1098 (comment), that's equivalent to a SparseVector, which might be more performant. We could also afford to store a dense Vector if that's faster (it's no longer than some of the other vectors).
I also suspect that num_inactive is almost always zero for all variables. It might thus be worth making it Union{Nothing, Dict{Int,Int}} or Union{Nothing, (Sparse)Vector{Int}}, where the nothing would mark no variable as having inactive entries, and these checks could be compiled away. num_inactive is checked on every call to getindex_internal(vnv, Colon) and update_internal!!, so this might make a difference.
Currently VNV's
num_inactivefield is aDict{Int,Int}(or before #1098 anOrderedDict{Int,Int}). As @penelopeysm noted in #1098 (comment), that's equivalent to aSparseVector, which might be more performant. We could also afford to store a denseVectorif that's faster (it's no longer than some of the other vectors).I also suspect that
num_inactiveis almost always zero for all variables. It might thus be worth making itUnion{Nothing, Dict{Int,Int}}orUnion{Nothing, (Sparse)Vector{Int}}, where thenothingwould mark no variable as having inactive entries, and these checks could be compiled away.num_inactiveis checked on every call togetindex_internal(vnv, Colon)andupdate_internal!!, so this might make a difference.