You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MapStack is in a hot path but is uses BTreeMap under the hood.
This optimization will make MapStack insertions and deletions O(1) rather than O(log n).
Let's change MapStack to be less generic, forcing key to be usize. Next let's make sure to only use small numbers for keys.
If we ensure both of those things, we can change the BTreeMap<K, V> in mapstack to Vec<Option<V>>.
The text was updated successfully, but these errors were encountered:
MapStack is in a hot path but is uses
BTreeMap
under the hood.This optimization will make
MapStack
insertions and deletionsO(1)
rather thanO(log n)
.Let's change
MapStack
to be less generic, forcing key to beusize
. Next let's make sure to only use small numbers for keys.If we ensure both of those things, we can change the
BTreeMap<K, V>
in mapstack toVec<Option<V>>
.The text was updated successfully, but these errors were encountered: