diff options
author | Tharanga Gamaethige <tgamaethige@netflix.com> | 2019-05-20 10:52:02 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2019-05-20 13:26:29 -0700 |
commit | 79f90d1ebfa61786ad7a821e4aa42da589c77ba5 (patch) | |
tree | ed94d41242aa277d3a931c1875294961958ad9d6 | |
parent | 43c0c37ba66ba10b6d58788d2d86cc7481cb3c6f (diff) | |
download | memcached-79f90d1ebfa61786ad7a821e4aa42da589c77ba5.tar.gz |
Speed up incr/decr by replacing snprintf.1.5.15
Uses fast itoa_u64 function instead. Fixes #471
-rw-r--r-- | memcached.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/memcached.c b/memcached.c index 0ab7a81..67530b1 100644 --- a/memcached.c +++ b/memcached.c @@ -4363,7 +4363,7 @@ enum delta_result_type do_add_delta(conn *c, const char *key, const size_t nkey, } pthread_mutex_unlock(&c->thread->stats.mutex); - snprintf(buf, INCR_MAX_STORAGE_LEN, "%llu", (unsigned long long)value); + itoa_u64(value, buf); res = strlen(buf); /* refcount == 2 means we are the only ones holding the item, and it is * linked. We hold the item's lock in this function, so refcount cannot |