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
First of all, wonderful work on implementing interfaces to so many varieties of instruments!
I have especially benefited a lot from the IMAQ interface for my own project, where I need to interact with an NI PCIe-1433 frame grabber. Although it has been working smoothly, I have one suggestion regarding the performance enhancement. Specifically, I am referring to this line of code in IMAQ.py. The call to numpy.ndarray.copy() looks superfluous to me, as it only increases memory footprint and execution time. For a better performance, one can just return data. At least with my unexhaustive tests, this replacement works well. On the other hand, the gain is sizable, as now I can handle more throughput.
Cheers,
Xiangcheng
The text was updated successfully, but these errors were encountered:
As far as I remember, this line is required to have predictable behavior in some situations. Up until that point, data numpy array is directly mapped onto the acquisition ring buffer memory. Furthermore, in most cases its value will not get copied in the later code either (unless different frame axes indexing is used). Therefore, as soon as the buffer is cycled through and that frame is overwritten, the perceived values of data will change. Probably, most users do not expect that, but rather assume that the data received from the camera will stay constant.
That being said, I agree that if you intend to process the received frame right away (before it gets overwritten), this copying is not necessary, and it hurts perfromance. In the future, I will likely add an option to forego this copy operation (and similar ones done in other cameras) at the user's risk.
Hi Alexey,
First of all, wonderful work on implementing interfaces to so many varieties of instruments!
I have especially benefited a lot from the IMAQ interface for my own project, where I need to interact with an NI PCIe-1433 frame grabber. Although it has been working smoothly, I have one suggestion regarding the performance enhancement. Specifically, I am referring to this line of code in IMAQ.py. The call to
numpy.ndarray.copy()
looks superfluous to me, as it only increases memory footprint and execution time. For a better performance, one can justreturn data
. At least with my unexhaustive tests, this replacement works well. On the other hand, the gain is sizable, as now I can handle more throughput.Cheers,
Xiangcheng
The text was updated successfully, but these errors were encountered: