Share data between identical session commands
If two or more session commands contain identical buffers, the buffer of the first session command is shared between the others. This reduces the amount of memory used to store repeated executions of session commands. The purging of session command history in readwritesplit was replaced with session command de-duplication. This was done to prevent problems that could arise when the order of session commands plays a significant role.
This commit is contained in:
@ -92,4 +92,11 @@ std::string SessionCommand::to_string()
|
||||
return str;
|
||||
}
|
||||
|
||||
void SessionCommand::mark_as_duplicate(const SessionCommand& rhs)
|
||||
{
|
||||
ss_dassert(eq(rhs));
|
||||
// The commands now share the mxs::Buffer that contains the actual command
|
||||
m_buffer = rhs.m_buffer;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user