2 ms·
I was assuming you'd use a standard deque that could hide the complexity of prepending. I didn't consider that the ordinal actually matters from the parent, th
by taeric 10y ago
I was assuming you'd use a standard deque that could hide the complexity of prepending. I didn't consider that the ordinal actually matters from the parent, though. So great point! :)
And yes, this was essentially my question. What are the realistic numbers in either scenario.
- jdmichal 10y agoRight. If you don't cache the ordinal, than "next sibling" and "previous sibling" operations have to scan the array. But it's a relatively easy performance enhancement to have a validity flag for the ordinals, and only rewrite them when a read requires them. That way, write-heavy workloads won't be punished.