-
Notifications
You must be signed in to change notification settings - Fork 523
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
SBE decoding for composite types inefficiency #599
Comments
Here is a piece of code to play with: https://godbolt.org/z/S8x7Rw. As a part of this issue we can discuss the following optimizations:
Maybe there're some SBE features which are not compatible with this approach. But usual C++ way is not paying for things you don't use. Another part could be adding configurable attributes to methods. |
wrt having configurable attributes to methods, please submit a different issue for adding that. I think that is useful and we can track it separately. For composites, I think we can do better. Here are my thoughts.
|
One option for preserving bounds checking, but removing the need to keep bufferLength is to add a specific wrap mechanism for |
Has there been any though on this topic since the last post? Any plans to make changes or resume the discussion? |
Nothing we've had time to look into. |
Given the constructors we now have on composites and bit sets we could not keep them as members and return them by value rather than by reference. This could optimise and inline better locally. |
SBE for composite types generates full scale wrappers with all the nested fields.
For example from the generated code for delegate:
Here is a message with composite field common:
So for every nested composite field (even if this composite contain only one primitive field) you get extra 32 bytes in SBE wrapper.
GCC can’t optimize the memory layout. All these fields must be initialized.
Also in a majority of cases GCC can’t inline the whole chain of calls down to individual atomic field within the message.
The text was updated successfully, but these errors were encountered: