Currently, the the IO thread just computes the cluster slot based on the first key, to be able to prefetch the keys.
When getNodeByQuery is executed (detects cross-slot commands, etc.) then it needs to check that all keys hash to the same slot. To make it possible to skip this step, the IO thread would need to check all keys and only set c->slot if all keys hash to the same slot. Then, getNodeByQuery can trust c->slot if it's already set and skip the expensive hashslot calculations.
Currently, the the IO thread just computes the cluster slot based on the first key, to be able to prefetch the keys.
When getNodeByQuery is executed (detects cross-slot commands, etc.) then it needs to check that all keys hash to the same slot. To make it possible to skip this step, the IO thread would need to check all keys and only set c->slot if all keys hash to the same slot. Then, getNodeByQuery can trust c->slot if it's already set and skip the expensive hashslot calculations.