[MCOL-3382] ByteStream performance Created: 2019-06-14  Updated: 2023-03-06

Status: Closed
Project: MariaDB ColumnStore
Component/s: Build
Affects Version/s: 1.0.0
Fix Version/s: Icebox

Type: Bug Priority: Minor
Reporter: David Mott (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

messageqcpp::ByteStream was refactored and it was identified to have some inefficiencies. In the prior version it had a constructor and assignment operator that accepted shared_ptr<ByteStream> . This resulted in a lot of compiler implicit copies which arent immediately obvious. For example:

ByteStream ClientRotator::read(){
mutex::scoped_lock lk(fClientLock);
ByteStream bs;
if (!fClient)
connect();
try
{
bs = fClient->read();
return bs;

here fClient->read() returns a shared_ptr<ByteStream> where a temporary ByteStream is copied into then the temporary is assigned to bs. If RVO weren't performed a third copy would get returned to the caller. A better option here is for ClientRotator::read() to return shared_ptr<ByteStream> and avoid the copies. It's unclear where or how many of these are in the code base. Upon first look liboamcpp.cpp has a lot of inefficiencies. All usage should be investigated.


Generated at Thu Feb 08 02:42:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.