Optimizations after replacing SplPriorityQueue by an array