You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you enable precedence checks (sbe.enable.precedence.checks=true), the generated code is supposed to be managed using the SBE_ENABLE_PRECEDENCE_CHECKS macro. The expectation is that with this flag enabled, precedence check should be enabled and with this flag NOT enabled there should be no overhead and the code should be usable in production. However upon inspection it seems that the code does have some overhead also when the macro is disabled. For example the m_codeState and corresponding pointers in the group wrappers do add some overhead. Currently user has three different options of code generation:
sbe.enable.precedence.checks=false - the "standard" version without any overhead and no checks
sbe.enable.precedence.checks=true and the SBE_ENABLE_PRECEDENCE_CHECKS macro enabled - debug only version with checks and significant overhead
sbe.enable.precedence.checks=true and the SBE_ENABLE_PRECEDENCE_CHECKS macro disabled - quite a pointless version with zero checks but some overhead caused by adding more variables.
I can see two ways to solve this situation - either drop the SBE_ENABLE_PRECEDENCE_CHECKS macro and with the sbe.enable.precedence.checks=true flag generate code that always does precedence checks (should simplify the generated code) or polish the generated code not to have any overhead with the SBE_ENABLE_PRECEDENCE_CHECKS macro enabled. The second approach seems more complicated but also much more consistent with what other language generators do.
The text was updated successfully, but these errors were encountered:
When you enable precedence checks (sbe.enable.precedence.checks=true), the generated code is supposed to be managed using the
SBE_ENABLE_PRECEDENCE_CHECKS
macro. The expectation is that with this flag enabled, precedence check should be enabled and with this flag NOT enabled there should be no overhead and the code should be usable in production. However upon inspection it seems that the code does have some overhead also when the macro is disabled. For example them_codeState
and corresponding pointers in the group wrappers do add some overhead. Currently user has three different options of code generation:SBE_ENABLE_PRECEDENCE_CHECKS
macro enabled - debug only version with checks and significant overheadSBE_ENABLE_PRECEDENCE_CHECKS
macro disabled - quite a pointless version with zero checks but some overhead caused by adding more variables.I can see two ways to solve this situation - either drop the
SBE_ENABLE_PRECEDENCE_CHECKS
macro and with thesbe.enable.precedence.checks=true
flag generate code that always does precedence checks (should simplify the generated code) or polish the generated code not to have any overhead with theSBE_ENABLE_PRECEDENCE_CHECKS
macro enabled. The second approach seems more complicated but also much more consistent with what other language generators do.The text was updated successfully, but these errors were encountered: