Yeah, but heapq pops off the front of the list, and that's a fair bit slower than popping off the back of the list. See https://gist.github.com/smerritt/8045982 for a quick benchmark script.
That said, if heapq winds up being faster than what we're doing, go for it. I'm just pointing out that it might not win.
Yeah, but heapq pops off the front of the list, and that's a fair bit slower than popping off the back of the list. See https:/ /gist.github. com/smerritt/ 8045982 for a quick benchmark script.
That said, if heapq winds up being faster than what we're doing, go for it. I'm just pointing out that it might not win.