mirror of
https://github.com/wassname/ray.git
synced 2026-08-09 12:20:09 +08:00
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:
committed by
Philipp Moritz
parent
7af6f462fb
commit
6f9225490b
@@ -7,6 +7,7 @@
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "io.h"
|
||||
#include <functional>
|
||||
|
||||
/* This is used to define the array of object IDs. */
|
||||
const UT_icd object_id_icd = {sizeof(ObjectID), NULL, NULL, NULL};
|
||||
@@ -29,6 +30,11 @@ UniqueID globally_unique_id(void) {
|
||||
return result;
|
||||
}
|
||||
|
||||
/* ObjectID equality function. */
|
||||
bool operator==(const ObjectID &x, const ObjectID &y) {
|
||||
return UNIQUE_ID_EQ(x, y);
|
||||
}
|
||||
|
||||
bool ObjectID_equal(ObjectID first_id, ObjectID second_id) {
|
||||
return UNIQUE_ID_EQ(first_id, second_id);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "utarray.h"
|
||||
#ifdef __cplusplus
|
||||
#include <functional>
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "sha256.h"
|
||||
@@ -152,6 +153,20 @@ UniqueID globally_unique_id(void);
|
||||
|
||||
typedef UniqueID ObjectID;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
struct UniqueIDHasher {
|
||||
/* ObjectID hashing function. */
|
||||
size_t operator()(const UniqueID &id) const {
|
||||
size_t result;
|
||||
memcpy(&result, id.id + UNIQUE_ID_SIZE - sizeof(size_t), sizeof(size_t));
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
bool operator==(const ObjectID &x, const ObjectID &y);
|
||||
#endif
|
||||
|
||||
#define ID_STRING_SIZE (2 * UNIQUE_ID_SIZE + 1)
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user