-
The reason is that I wanted to define a customize command, but found that the performance of dispatch() is relatively poor. test case as following: sync.set(key,value); vs sync.dispatch(io.lettuce.core.protocol.CommandType.SET,new StatusOutput<>(codec), new CommandArgs<>(codec).add().addValue() this gap has exceeded my understanding, wonder the reason... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey @Sinbol , Can you share the way you are making this benchmark? Both cases use (eventually) the same dispatch method. |
Beta Was this translation helpful? Give feedback.
I'm sorry for the delayed response. First thank you for your answer. And recently I have spent some more time researching the issue, and it seems that I have found the answer. The problem lies in the add() method. It seems that the parameter passed to add() cannot be treated as a key, so the correct node is not calculated before sending the command. As a result, the request triggers a move response in some nodes, and Lettuce retrieves the correct execution node from the move information. Obviously, this leads to a performance degradation. I have confirmed this issue by capturing packets. addKey() should be used here to solve the problem. Thank you for your attention again!