diff options
author | filipe oliveira <filipecosta.90@gmail.com> | 2022-12-04 08:11:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-04 10:11:38 +0200 |
commit | 61c85a2b2081dffaf45eb8c6b7754b8d9a80c60d (patch) | |
tree | 5f2643bf348fe7da7d3f72d5ed0df39415fcdddc /src/script.h | |
parent | 155acef51ac7826ed294a4b61d891f1c7a9a40ac (diff) | |
download | redis-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