eclipse-zenoh / zenoh-pico

Eclipse zenoh for pico devices
Other
123 stars 79 forks source link

Improve throughput performance (trigger local subscriber focus) #730

Closed jean-roland closed 1 month ago

jean-roland commented 1 month ago

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_subscriberand this PR aims to fix this.

The fastest code is the one we don't execute

github-actions[bot] commented 1 month ago

PR missing one of the required labels: {'internal', 'enhancement', 'dependencies', 'new feature', 'documentation', 'breaking-change', 'bug'}

DenisBiryukov91 commented 1 month ago

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.

jean-roland commented 1 month ago

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.