-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance[BMQ, MQB, MWC]: performance tune-up [1] #375
Conversation
b1e9d2d
to
05c6345
Compare
ace1e86
to
4be456c
Compare
bool doRetry = false; | ||
do { | ||
buildRc = d_storageEventBuilder.packMessage(type, | ||
d_config.partitionId(), | ||
0, // flags | ||
journalOffsetWords, | ||
journalRecordBlobBuffer); | ||
if (buildRc == bmqt::EventBuilderResult::e_EVENT_TOO_BIG && !doRetry) { | ||
flushIfNeeded(true); | ||
|
||
doRetry = true; | ||
} | ||
else { | ||
doRetry = false; | ||
} | ||
} while (doRetry); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an idea:
- get rid of a loop
- get rid of tmp
bool doRetry
- add performance hint
- as a bonus, in a debugger you will see that you are currently on the first try or on the second
bool doRetry = false; | |
do { | |
buildRc = d_storageEventBuilder.packMessage(type, | |
d_config.partitionId(), | |
0, // flags | |
journalOffsetWords, | |
journalRecordBlobBuffer); | |
if (buildRc == bmqt::EventBuilderResult::e_EVENT_TOO_BIG && !doRetry) { | |
flushIfNeeded(true); | |
doRetry = true; | |
} | |
else { | |
doRetry = false; | |
} | |
} while (doRetry); | |
buildRc = d_storageEventBuilder.packMessage(type, | |
d_config.partitionId(), | |
0, // flags | |
journalOffsetWords, | |
journalRecordBlobBuffer); | |
if (BSLS_PERFORMANCEHINT_PREDICT_UNLIKELY(buildRc == bmqt::EventBuilderResult::e_EVENT_TOO_BIG)) { | |
BSLS_PERFORMANCEHINT_UNLIKELY_HINT; | |
flushIfNeeded(true); | |
buildRc = d_storageEventBuilder.packMessage(type, | |
d_config.partitionId(), | |
0, // flags | |
journalOffsetWords, | |
journalRecordBlobBuffer); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer a version calling packMessage
once, loop is ok, BSLS_PERFORMANCEHINT_PREDICT_UNLIKELY
is a good idea
const bmqp::StorageHeader& header = iter.header(); | ||
if (pid != header.partitionId()) { | ||
// A storage event is sent by 'source' cluster node. The node may | ||
// be primary for one or more partitions, but as per the BMQ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// be primary for one or more partitions, but as per the BMQ | |
// be primary for one or more partitions, but as per the BlazingMQ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small comment
@@ -494,6 +523,8 @@ class Cluster : public mqbi::Cluster, | |||
/// Execute `initiateShutdown` followed by `stop` and SIGINT | |||
void terminate(mqbu::ExitCode::Enum reason); | |||
|
|||
static const char* validationResult(const ValidationResult& result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This declaration doesn't have a definition now, right?
static const char* validationResult(const ValidationResult& result); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static const char* validationResult(const ValidationResult& result); |
Signed-off-by: dorjesinpo <[email protected]>
Signed-off-by: dorjesinpo <[email protected]>
Signed-off-by: dorjesinpo <[email protected]>
Signed-off-by: dorjesinpo <[email protected]>
f4ef7ad
to
c301113
Compare
* performance tune-up bloomberg#1 Signed-off-by: dorjesinpo <[email protected]> * Reverting the change causing IT failure Signed-off-by: dorjesinpo <[email protected]> * Addressing review Signed-off-by: dorjesinpo <[email protected]> * cleaning Signed-off-by: dorjesinpo <[email protected]> --------- Signed-off-by: dorjesinpo <[email protected]>
* performance tune-up bloomberg#1 Signed-off-by: dorjesinpo <[email protected]> * Reverting the change causing IT failure Signed-off-by: dorjesinpo <[email protected]> * Addressing review Signed-off-by: dorjesinpo <[email protected]> * cleaning Signed-off-by: dorjesinpo <[email protected]> --------- Signed-off-by: dorjesinpo <[email protected]>
* performance tune-up bloomberg#1 Signed-off-by: dorjesinpo <[email protected]> * Reverting the change causing IT failure Signed-off-by: dorjesinpo <[email protected]> * Addressing review Signed-off-by: dorjesinpo <[email protected]> * cleaning Signed-off-by: dorjesinpo <[email protected]> --------- Signed-off-by: dorjesinpo <[email protected]>
First half of 181