Skip to content

Commit d3224c5

Browse files
authored
[OPTIMIZE] Enhance performance in DistributedObjectStore::get (#141)
1 parent 7048dc7 commit d3224c5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mooncake-integration/vllm/distributed_object_store.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,12 @@ pybind11::bytes DistributedObjectStore::get(const std::string &key) {
322322
return kNullString;
323323
}
324324

325+
if (slices.size() == 1 && slices[0].size == str_length) {
326+
auto result = pybind11::bytes((char *)slices[0].ptr, str_length);
327+
freeSlices(slices);
328+
return result;
329+
}
330+
325331
const char *str = exportSlices(slices, str_length);
326332
freeSlices(slices);
327333
if (!str) return kNullString;

0 commit comments

Comments
 (0)