Add clarification about commands arguments#120
Conversation
|
Actually they should have similar performance since ioredis passes arguments to the |
|
Yes, but using an array of arguments will "remove" this loop. |
|
Sounds interesting. I wrote a tests for it: https://gist.github.com/luin/d06770c736866e0571d0. The result shows the former form is little faster. It looks like |
|
That's indeed interesting, I would have never expected that. |
|
Here is my own test case which confirms my original assumption. |
|
I ran your test case and got the similar result as yours. I though there may be too few arguments in my previous test case, so I updated it but the results between the two forms are still slight. Don't know why. |
|
I don't know either, but it doesn't matter, I doubt that someone will ever use a number of arguments big enough to make the difference. |
|
It could be that array wasnt optimized (diff types of values, not all strings for instance) or some other similar case
|
This tweaks a comment to make clear that when the number of arguments is big, using an array results in better performances.
Correct me if I'm wrong.