mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
chore: improve performance of mget operation (#2212)
Specifically, allocate only a single blob when returning multiple entries from a shard. In addition, refactor and unify MGetResponse between string family code and ReplyBuilder code. Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
dafdb9f4cf
commit
7d53d196aa
11 changed files with 194 additions and 120 deletions
|
@ -973,7 +973,7 @@ OpResult<vector<OptLong>> OpArrIndex(const OpArgs& op_args, string_view key,
|
|||
}
|
||||
|
||||
// Returns string vector that represents the query result of each supplied key.
|
||||
vector<OptString> OpMGet(JsonExpression expression, const Transaction* t, EngineShard* shard) {
|
||||
vector<OptString> OpJsonMGet(JsonExpression expression, const Transaction* t, EngineShard* shard) {
|
||||
auto args = t->GetShardArgs(shard->shard_id());
|
||||
DCHECK(!args.empty());
|
||||
vector<OptString> response(args.size());
|
||||
|
@ -1271,7 +1271,7 @@ void JsonFamily::MGet(CmdArgList args, ConnectionContext* cntx) {
|
|||
|
||||
auto cb = [&](Transaction* t, EngineShard* shard) {
|
||||
ShardId sid = shard->shard_id();
|
||||
mget_resp[sid] = OpMGet(ParseJsonPath(path, &ec), t, shard);
|
||||
mget_resp[sid] = OpJsonMGet(ParseJsonPath(path, &ec), t, shard);
|
||||
return OpStatus::OK;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue