Redis中mget()的时间复杂度是多少?

this library has mget implementation https://github.com/go-redis/redis .It seems like the time complexity is O(N),where n is the number of keys

https://github.com/wuxibin89/redis-go-cluster Here the time complexity is O(N /total nodes in cluster)

How is the default mget() implemented in redis in terms of time complexity ?

Here is the implementation of the method in the library you sent: https://github.com/wuxibin89/redis-go-cluster/blob/222d81891f1d3fa7cf8b5655020352c3e5b4ec0f/multi.go#L99

it looks like it executes every task concurrently to every node https://github.com/wuxibin89/redis-go-cluster/blob/222d81891f1d3fa7cf8b5655020352c3e5b4ec0f/multi.go#L144 and waits for the response

I think that it should work differently - the library sends the request to master Redis cluster and the cluster should deal with replication etc. It's probably the case of the decreased performance.

Please consider another library like https://github.com/go-redis/redis.