Reputation: 35
What is the most common way is to retrieve all values in a list when those values are relatively large serialised Ruby objects?
For example:
I need to iterate through all of these values in Ruby, is it more performant to:
lrange
to get all the values in one trip, then iterate through them in Rubyllen
to count the values in the list, then loop through in Ruby using lindex
to retrieve each value as an individual trip to RedisUpvotes: 1
Views: 1190
Reputation: 230286
I'd say, it makes no difference. Choose one that is easier to code for you. Any speed gains from using LRANGE will be dominated by time needed to transfer your large objects. I would probably process them one by one, this way it uses less memory.
Upvotes: 1