nvictus/pqdict

Performance Comparison with heapq

Closed this issue · 1 comments

@nvictus Do you have a runtime comparison of this library with heapq? Unlike heapq, which does not support changing the priority of items already in the priority queue, while pqdict does. Given that heapq only supports push, pop, pushpop, and poppush (heapreplace) operations, how does pqdict compare in terms of performance on these operations?

The implementations of the core operators are based on the pure Python implementation of the heapq module (which is the fallback to the C implementation) and should have similar performance on common operations with some overhead of keeping the position dictionary updated.

I've never done a formal benchmark but would welcome a PR with a benchmarking script.