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
Is your feature request related to a problem? Please describe.
The recent ide refactor #1804 uses a SizeBoundedMap to keep track of DiagramIDs and StepSequenceIDs, which maintains a queue internally, deleting the least-recent entries when the size of the map exceeds the max. Currently, this queue is just an array which is shifted, causing most operations to have $O(n)$ complexity. When we start keeping track of larger numbers of these ids, it will be nice to improve this complexity (either with a linked list, or by moving to a different scheme for automatic deletion).
Describe alternatives you've considered
Another (likely better) specifically for step sequences option is to use the doubly-linked list that already exists between step sequences to throw out old sequences:
We maintain a reference to the "head" step sequence (whose parent is null)
When the number of step sequences exceeds maxLen, delete the head and set the child's parent to null
When an internal node is deleted, recursively delete its children.
This has the advantage of maintain more clear invariants about when children/parents actually exist. For DiagramIDs, we would still need the size bounded map, hopefully with better time complexity.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
The recent ide refactor #1804 uses a$O(n)$ complexity. When we start keeping track of larger numbers of these ids, it will be nice to improve this complexity (either with a linked list, or by moving to a different scheme for automatic deletion).
SizeBoundedMap
to keep track ofDiagramID
s andStepSequenceID
s, which maintains a queue internally, deleting the least-recent entries when the size of the map exceeds the max. Currently, this queue is just an array which is shifted, causing most operations to haveDescribe alternatives you've considered
Another (likely better) specifically for step sequences option is to use the doubly-linked list that already exists between step sequences to throw out old sequences:
null
)maxLen
, delete the head and set the child's parent to nullThis has the advantage of maintain more clear invariants about when children/parents actually exist. For
DiagramID
s, we would still need the size bounded map, hopefully with better time complexity.The text was updated successfully, but these errors were encountered: