Perf: concrete mqbi::DispatcherEvent events - #1116
Conversation
a2689f8 to
f132bff
Compare
mqbi::DispatcherEvent inheritance, event sources per event typemqbi::DispatcherEvent inheritance, event sources per event type
5333fc9 to
e227be8
Compare
mqbi::DispatcherEvent inheritance, event sources per event typemqbi::DispatcherEvent inheritance
26a6afd to
78775ae
Compare
mqbi::DispatcherEvent inheritancemqbi::DispatcherEvent events
ade84c9 to
28ee596
Compare
e4b0209 to
f4a0012
Compare
| .setSource(&d_cs) // DispatcherClient *value | ||
| .setPutHeader(putHeader) | ||
| .setBlob(eventBlob) // const bsl::shared_ptr<bdlbb::Blob>& value | ||
| .setCompressionAlgorithmType(cat); |
There was a problem hiding this comment.
I have simplified isRelay usage. For some event types, it is always true or always false. In such cases, possible to remove this flag fully.
Also I have removed other unused fields. In this case, we don't access compression algorithm type for PUT events, so there is no need to set it or keep it.
With concrete event types, it is easier to keep track on what is used and what is not used.
ba08272 to
cfcc2b7
Compare
|
|
||
| /// Execute the specified `functor`, using the `e_CALLBACK` event | ||
| /// type, in the processor associated to this object. | ||
| void execute(const mqbi::Dispatcher::VoidFunctor& functor); |
There was a problem hiding this comment.
Only the mqbs::FileStore has dispatchEvent and execute.
These functions might be defined for mqbi::DispatcherClient and be used more often by its implementations. It can be done in the next refactor, here I decided not to add this to the diff.
cda39c1 to
21bebcf
Compare
| bmqt::CompressionAlgorithmType::Enum d_compressionAlgorithmType; | ||
|
|
||
| /// Whether the associated PUSH message is out-of-order. | ||
| bool d_isOutOfOrderPush; |
There was a problem hiding this comment.
I did not try to optimize memory layouts in this PR for simplicity, will do it later. We can win a few more bytes in some cases.
678098
left a comment
There was a problem hiding this comment.
Self-review is ok
262fb89 to
ffa6d14
Compare
ffa6d14 to
757f955
Compare
Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
757f955 to
f2aec06
Compare
|
@hallfox applied fixes in the second commit |
|
|
||
| namespace { | ||
| const int k_POOL_GROW_BY = 1024; | ||
| BSLS_KEYWORD_CONSTEXPR int k_POOL_GROW_BY = 1024; |
There was a problem hiding this comment.
Since this compiles to nothing on Solaris it's still good to have the const qualifier here. According to the BDE docs this is a recommended way for using the CONSTEXPR keyword.
Signed-off-by: Evgenii Malygin <emalygin@bloomberg.net>
Changes
mqbevt.mqbi::DispatcherEventa base class for 12 concrete dispatcher event types. Move the sources of concrete event types tomqbevtpackage group..cppfiles, keep forward declarations to them in.h. This prevents leaking of heavy includes such asbmqp_protocol.h.isRelaywhere it's not needed.asCallbackEvent()with templated ones likethe<mqbevt::CallbackEvent>().Benchmarks
Linux x86_64
Before:
After:
Mac M2
Before:
After: