MB-21650: Don't copy key when servicing memcached get() request
In the get request path (EvpGet() and onwards) we take a copy of the
key from the request packet into a std::string. This is then passed
around ep-engine (read-only) to retrieve the document to return to the
user.
This incurs the cost of creating a std::string object per get request,
along with the related memory tracking overheads which are not
insigificant (see ObjectRegistry).
To reduce this cost, use a const_sized_buffer (essentially a pair of
{const char*, size_t}) for the key, relying on the fact that the
client's request is always available in the request packet owned by
memcached.
On the 2-node 'hera' cluster this improves the op/s of the following
pillowfight benchmark, from 1.8M op/s total to 2.3M op/s:
cbc-pillowfight --spec couchbase://172.23.96.117:12000/default \
--batch-size 1000 --num-items 1000000 --num-threads 50 \
--min-size 512 --max-size 512 --set-pct 20
(client running on 3rd hera-client node).
Change-Id: I0371fb5ef9bdcdc6f92bb941926e8af80cf5e24f
Reviewed-on: http://review.couchbase.org/70023
Reviewed-by: Daniel Owen <owend@couchbase.com>
Tested-by: buildbot <build@couchbase.com>