Which of the following loops will run quicker in a Redis Lua Script for 10,000 iterations. Or will they both run at the same speed.
Does accessing a redis key inside a lua script take the same amount of time as accessing a local variable, e.g a value at a specific index of a table.
local members = redis.pcall('smembers','10000memberset')
for i=1,table.getN(members) do
local value = members[i]
-- do some logic on the value
end
or
for i=1,10000 do
local value = redis.pcall('get',i)
-- do some logic on the value
end
Thanks!