Plasma manager performance: speed up wait with a wait request object map (#427)

* plasma manager perf: speedup wait with a wait request object map

* removing duplicate == operator in plasma store

* fix serialization test

* code cleanup

* minor cleanup

* factoring out uniqueid hash and equality operators into common

* plasma manager: c++ify the WaitRequest struct

* plasma manager: get rid of the initial object request malloc

* cleanup

* linting

* cleanups and fix compiler warnings

* compiler warnings and linting
This commit is contained in:
Alexey Tumanov
2017-04-07 12:32:12 -07:00
committed by Philipp Moritz
parent 7af6f462fb
commit 6f9225490b
8 changed files with 138 additions and 114 deletions
+11 -8
View File
@@ -498,7 +498,7 @@ int plasma_read_WaitRequest_num_object_ids(uint8_t *data) {
}
void plasma_read_WaitRequest(uint8_t *data,
ObjectRequest object_requests[],
ObjectRequestMap &object_requests,
int num_object_ids,
int64_t *timeout_ms,
int *num_ready_objects) {
@@ -509,23 +509,26 @@ void plasma_read_WaitRequest(uint8_t *data,
CHECK(num_object_ids == message->object_requests()->size());
for (int i = 0; i < num_object_ids; i++) {
object_requests[i].object_id =
ObjectID object_id =
from_flatbuf(message->object_requests()->Get(i)->object_id());
object_requests[i].type = message->object_requests()->Get(i)->type();
ObjectRequest object_request({object_id,
message->object_requests()->Get(i)->type(),
ObjectStatus_Nonexistent});
object_requests[object_id] = object_request;
}
}
int plasma_send_WaitReply(int sock,
protocol_builder *B,
ObjectRequest object_requests[],
const ObjectRequestMap &object_requests,
int num_ready_objects) {
flatbuffers::FlatBufferBuilder fbb(FLATBUFFER_BUILDER_DEFAULT_SIZE);
std::vector<flatbuffers::Offset<ObjectReply>> object_replies;
for (int i = 0; i < num_ready_objects; i++) {
object_replies.push_back(
CreateObjectReply(fbb, to_flatbuf(fbb, object_requests[i].object_id),
object_requests[i].status));
for (const auto &entry : object_requests) {
const auto &object_request = entry.second;
object_replies.push_back(CreateObjectReply(
fbb, to_flatbuf(fbb, object_request.object_id), object_request.status));
}
auto message = CreatePlasmaWaitReply(