Yes -- I'll add a comment. Each subqueue keeps track of its locks and waiting jobs in sorted sets, and removing multiple elements at once is much cheaper than repeatedly removing each single element. There are potentially many, however, and so I'm batching them as I go.

As I move jobs from one queue to another during resizing, I need to keep track of the jobs I have to remove from the source subqueue as I add them to the destination subqueue.