You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-4810 Redundant copying and wasting memory in PrimProc
This patch eliminates a copying `long string`s into the bytestream.
This commit is contained in:
@ -173,14 +173,7 @@ void StringStore::serialize(ByteStream& bs) const
|
||||
bs.append(mc->data, mc->currentSize);
|
||||
}
|
||||
|
||||
bs << (uint64_t) longStrings.size();
|
||||
|
||||
for (i = 0; i < longStrings.size(); i++)
|
||||
{
|
||||
mc = (MemChunk*) longStrings[i].get();
|
||||
bs << (uint64_t) mc->currentSize;
|
||||
bs.append(mc->data, mc->currentSize);
|
||||
}
|
||||
bs.setLongStrings(longStrings);
|
||||
}
|
||||
|
||||
void StringStore::deserialize(ByteStream& bs)
|
||||
@ -211,20 +204,7 @@ void StringStore::deserialize(ByteStream& bs)
|
||||
bs.advance(size);
|
||||
}
|
||||
|
||||
bs >> count;
|
||||
longStrings.resize(count);
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
bs >> size;
|
||||
buf = bs.buf();
|
||||
longStrings[i].reset(new uint8_t[size + sizeof(MemChunk)]);
|
||||
mc = (MemChunk*) longStrings[i].get();
|
||||
mc->capacity = mc->currentSize = size;
|
||||
memcpy(mc->data, buf, size);
|
||||
bs.advance(size);
|
||||
}
|
||||
|
||||
longStrings = bs.getLongStrings();
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user