epics-extensions / ca-gateway

Channel Access PV Gateway
http://www.aps.anl.gov/epics/extensions/gateway/
Other
17 stars 17 forks source link

Performance improvement for large arrays handling #39

Closed MaciejPatro closed 2 years ago

MaciejPatro commented 2 years ago

Hello!

During event callbacks for arrays of data the memset fills whole allocated memory which than is overridden by memcpy in next line. This leads to visible performance degradation for very large arrays (for example images).

In pull request the data is copied and then the "unused" part of the array is filled with zeros.

Besides of that I've aligned indentation of the whole gatePv.cc file to be consistent. Two changes are done in separate commits.

ralphlange commented 2 years ago

Thanks for this improvement!

I did not take your indentation commit, as it was changing things "in the wrong direction": for all EPICS related modules, the target format is "4 spaces" with all TAB characters removed. (Most often we are doing this lazy, i.e. only for lines or functions that are touched anyway.) Thanks for keeping those changes in a separate commit!