Closed ariasanovsky closed 1 year ago
Currently, we make expensive key clones. With the BTreeMap tree, this is necessary to avoid having a & to data under a &mut.
BTreeMap
&
&mut
The cost of this is high, including many temporary Vec's (c.f. ActionsTaken).
Vec
ActionsTaken
To resolve this:
Vec<BTreeMap>
INTTransitions
Vec<Entry>
Vec<(ActionsTaken, ...)>
refactor INTTransitions to hold a Vec instead of Vec<(ActionsTaken, ...)> Used a Vec<(&mut StateData, ...)> instead due to Entry semantics.
Vec<(&mut StateData, ...)>
Entry
Currently, we make expensive key clones. With the
BTreeMap
tree, this is necessary to avoid having a&
to data under a&mut
.The cost of this is high, including many temporary
Vec
's (c.f.ActionsTaken
).To resolve this:
BTreeMap
with aVec<BTreeMap>
, preserving identical behaviorINTTransitions
to hold aVec<Entry>
instead ofVec<(ActionsTaken, ...)>