Open isaacl opened 4 years ago
Do you know if that implementation is published as a package anywhere?
I wonder how this compares to double-ended-queue for pg’s purposes. It’s probably a bit slower, but that’s minor compared to everything else pg does, plus it’s simpler and the arrays shrink automatically. A clear winner?
I wrote that for this bug. Yes its is probably a bit slower than a double ended queue (or a circular buffer).
Probably doesn't matter most of the time, but arrays are poorly suited as a queue.
shift()
is an O(n) operation. Better would be a simple structure which has amortized O(1) operations: