mirror of
https://github.com/vale981/ray
synced 2025-03-09 04:46:38 -04:00
Optimize ray::LocalMemoryBuffer performance (#6384)
This commit is contained in:
parent
032e8553c7
commit
64d8626d6d
1 changed files with 3 additions and 2 deletions
|
@ -55,7 +55,8 @@ class LocalMemoryBuffer : public Buffer {
|
||||||
: has_data_copy_(copy_data) {
|
: has_data_copy_(copy_data) {
|
||||||
if (copy_data) {
|
if (copy_data) {
|
||||||
RAY_CHECK(data != nullptr);
|
RAY_CHECK(data != nullptr);
|
||||||
buffer_.insert(buffer_.end(), data, data + size);
|
buffer_.resize(size);
|
||||||
|
std::copy(data, data + size, buffer_.begin());
|
||||||
data_ = buffer_.data();
|
data_ = buffer_.data();
|
||||||
size_ = buffer_.size();
|
size_ = buffer_.size();
|
||||||
} else {
|
} else {
|
||||||
|
@ -79,7 +80,7 @@ class LocalMemoryBuffer : public Buffer {
|
||||||
|
|
||||||
bool IsPlasmaBuffer() const override { return false; }
|
bool IsPlasmaBuffer() const override { return false; }
|
||||||
|
|
||||||
~LocalMemoryBuffer() {}
|
~LocalMemoryBuffer() { size_ = 0; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Disable copy constructor and assignment, as default copy will
|
/// Disable copy constructor and assignment, as default copy will
|
||||||
|
|
Loading…
Add table
Reference in a new issue