Nordix / hiredis-cluster

C client library for Valkey/Redis Cluster. This project is used and sponsored by Ericsson. It is a fork of the now unmaintained hiredis-vip.
BSD 3-Clause "New" or "Revised" License
87 stars 42 forks source link

optimization: use memcmp instead of strncmp for ASK, MOVED, etc. #151

Closed zhuizhuhaomeng closed 1 year ago

zhuizhuhaomeng commented 1 year ago

@bjosv any progress on this PR?

bjosv commented 1 year ago

Hi @zhuizhuhaomeng, thanks for the PR! We have discussed it a bit and we like the memcmp() change that is better, but we think using strlen() is easier to read than sizeof() - 1. Could we keep the strlen() parts for readability since the compiler seems to optimize it nicely anyway? WDYT?

zhuizhuhaomeng commented 1 year ago

@bjosv I have updated the PR.