add members_only option. #10
Conversation
|
That seems like a reasonable feature. 👍 |
_parse_raw_leaders handles the common logic for parsing results data from a leader query.
|
please take another look |
|
(replace Hash w/ Dictionary for Python here, just thinking about then porting this to the Ruby and CoffeeScript libraries) One thought here, the current behavior is that you're always getting an array of Hash objects, but with the |
|
From a consistency standpoint returning a hash/dict is probably preferable. Furthermore, the speedup was not primary because I dropped the dict allocation, but because I dropped 1 round-trip to the redis server which included N * 2 commands, where N was the size of the result set. The difference between allocating a dict for each member and not doing so is something in the range of 10 µs. I'll update my tests and make new commit with these changes. |
Haven't added tests for this pull request yet, waiting for an OK from you.
The idea here is that in some cases you are really just interested in the
memberof the sorted set and you don't care about it's score or rank. In those cases the ranking function will have a negative impact on performance, while the results of it are discarded.This case applies to your Ruby activity_feed library. In my Python port I could see the following difference by adding this option.
before:

after:
