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
Simple red black tree for price levels in a single storage item
Orders within a price level as ring-buffer based doubly linked list
Ring buffer so can know next allocation spot without having to always reshuffle (e.g. like in a vector insert)
The allocated vector never changes, just the next and last fields
2d ring buffer could have max elems in a storage node, and have each node be doubly linked list yet again (like BigVector)
Hence for O(1) lookup need pointer to table ring buffer and vector ring buffer
Except if static space for price levels then need to evict entire level at once
Could use btree on its own for all orders, since maker address already 8 bytes and other data probably 30 or so
Could use b+ tree
Each order has a b+ tree key, which is price concatenated with a boundary flag
Basically if you have an order at price 5 and price 6 and need to insert at back of queue for price 5, look at the boundary flag on existing price 5 order (e.g. 000000), and increment by 1, so new order key is5 < 64 | 1 (this is like the dynamic pointer used for AVL queue) and thus goes between the two existing orders in total order search
Then need to store B+ access key under user table
The text was updated successfully, but these errors were encountered:
BigVector
)O(1)
lookup need pointer to table ring buffer and vector ring buffer000000
), and increment by 1, so new order key is5 < 64 | 1
(this is like the dynamic pointer used for AVL queue) and thus goes between the two existing orders in total order searchThe text was updated successfully, but these errors were encountered: