Closed jean-roland closed 1 month ago
PR missing one of the required labels: {'internal', 'enhancement', 'dependencies', 'new feature', 'documentation', 'breaking-change', 'bug'}
Looks good, but I do not really like the idea of memsetting everything to 0, especially for dependent structs. In case we modify null-constructors for their fields, we risk to face some difficult to detect bugs. I'm wondering if memsetting to 0 really provides a speed boost that is worth the cost.
I understand the issue, but then maybe we should make a distinction between _null
which would be some kind of memory initialization and _init
that would be a type initialization, in the case where those two operations are different.
If we distinguish the two then, I believe the performance increase won't cause problems.
There is a small performance dip in non-fragment peer throughput compared with 0.11. Profiling helped identify a much longer time spent in
trigger_local_subscriber
and this PR aims to fix this.Static inline functions: Functions that should have been inlined by the compiler (like
z_sample_null
) weren't. This is solved by explicitly setting all the_null
,_check
and_alias
functions tostatic inline
.Null functions: A lot of time was spent initializing types to 0 compared to just using
memset(0)
, switching all the_null
functions to a{0}
initialization closed this gap and is less prone to error.Slice init / string preallocate: This functions had many superfluous checks / init. They got simplified.
get_expanded_key_by_key: Added a shorter path for already expanded keys.
trigger_local_subcriber: Added a shorter path when there is 0 subscribers to trigger. Added a config token,
off
by default, to execute this function.The fastest code is the one we don't execute