mperham/sidekiq — pull request #1277 by aackerman (2013-10-24 02:36:06+00:00)
Title: Memoize size of a SortedSet to reduce calls to Redis when iterating

The work I did to fix deletion of items when iterating over a SortedSet essentially doubled the number of calls to Redis. We can fix this by saving a reference to the initial size and reducing the value when items are removed. So we drop the extra number of calls from N to 1.