summaryrefslogtreecommitdiff
path: root/src/script.h
diff options
context:
space:
mode:
authorfilipe oliveira <filipecosta.90@gmail.com>2022-12-04 08:11:38 +0000
committerGitHub <noreply@github.com>2022-12-04 10:11:38 +0200
commit61c85a2b2081dffaf45eb8c6b7754b8d9a80c60d (patch)
tree5f2643bf348fe7da7d3f72d5ed0df39415fcdddc /src/script.h
parent155acef51ac7826ed294a4b61d891f1c7a9a40ac (diff)
downloadredis-61c85a2b2081dffaf45eb8c6b7754b8d9a80c60d.tar.gz
Speedup GEODIST with fixedpoint_d2string as an optimized version of snprintf %.4f (#11552)
GEODIST used snprintf("%.4f") for the reply using addReplyDoubleDistance, which was slow. This PR optimizes it without breaking compatibility by following the approach of ll2string with some changes to match the use case of distance and precision. I.e. we multiply it by 10000 format it as an integer, and then add a decimal point. This can achieve about 35% increase in the achievable ops/sec. Co-authored-by: Oran Agra <oran@redislabs.com>
Diffstat (limited to 'src/script.h')
0 files changed, 0 insertions, 0 deletions