If I have a function with a return value, like string_at(ptr, size)
from ctypes
, and I dont use the returned string, is the call to this function removed by some kind of optimization? Or, is any performance improvement only because the string that should be returned, is never really copied to any variable/other memory address, and therefore the time to copy has been saved?
I try to understand this, as I want to achieve to collect images from a camera at a specific framerate. But it seems that this string_at(ptr, size)
call is slowing down the process. But, when I use the function without writing the return value to a variable, the performance can be achieved.
More information about the camera and the goal:
- 8 cameras from ximea that work synchronously
- The images are transferred from the camera to a ximea switch and from there to the PC via a PCI-e cable
- The images are transferred at the desired framerate (100 fps per camera)
- The collection is currently working in one thread, as the images should be collected at the "same" time. So in every collection step, an image from every camera should be collected.
- current achieved framerate is around 40 fps