From fb8755a636ed6457005ce9bd0ab2cc95ac40ca34 Mon Sep 17 00:00:00 2001 From: "Filipe Oliveira (Redis)" Date: Tue, 3 Sep 2024 13:54:20 +0100 Subject: [PATCH] changed addReplyHumanLongDouble to addReplyDouble in georadiusGeneric and geoposCommand (#13494) # Summary - Addresses https://github.com/redis/redis/issues/11565 - Measured improvements of 30% and 37% on the simple use-case (GEOSEARCH and GEOPOS) (check https://github.com/redis/redis/pull/13494#issuecomment-2313668934), and of 66% on a dataset with >60M datapoints and pipeline 10 benchmark. --- src/geo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/geo.c b/src/geo.c index 90817998a..cbb96cc25 100644 --- a/src/geo.c +++ b/src/geo.c @@ -796,8 +796,8 @@ void georadiusGeneric(client *c, int srcKeyIndex, int flags) { if (withcoords) { addReplyArrayLen(c, 2); - addReplyHumanLongDouble(c, gp->longitude); - addReplyHumanLongDouble(c, gp->latitude); + addReplyDouble(c,gp->longitude); + addReplyDouble(c,gp->latitude); } } } else { @@ -959,8 +959,8 @@ void geoposCommand(client *c) { continue; } addReplyArrayLen(c,2); - addReplyHumanLongDouble(c,xy[0]); - addReplyHumanLongDouble(c,xy[1]); + addReplyDouble(c,xy[0]); + addReplyDouble(c,xy[1]); } } }