Closed Tortar closed 6 months ago
I am having trouble understanding how this works. How can a binary heap be faster here? Do you have any idea why?
the motivation is that with a priority queue you can change the priority of a given key while here you can't, this is not something needed in our case, so that is why it is faster I think
And I think it is a lot faster if the all time is cut in half
fantastic, thanks for the great work. But how did you think of this? of changing the data structurte?
I was actually doing something else, and I needed something like a PriorityQueue
but it was too slow and would make the algorithm unusable, so I looked for alternatives, then I remembered that in Agents
we had a PriorityQueue
and I also remembered it had a bad impact on overall performance when I benchmarked it :-)
This makes RPS more than 2x faster! in general a
Heap
is more suitable than aPriorityQueue
for this task, also it actually makes everything better because aPriorityQueue
denied the use of duplicate times, which is actually something which could happen