SDK Performance between Python and C

Hello there,

I’d like to know if there are performance losses between Python and C for spatial mapping.
The Python SDK is just a wrapper for C code so it should not be a very big deal.
I’m using a Jetson Xavier NX but have not yet received the cameras.

Could you confirm or infirm ?

Thanks in advance

Hello and thank you for reaching us out,

The SDK is written with C++. All wrappers (C, python, C#) are just calling C++ methods in the end, so they cannot have a better performance than C++. However, the performance can be lower. Until very recently, the performance was pretty much the same for all wrappers, except for the following thing :

  • In the past (before 3.7), python had lesser performances in some cases, because the get_data() method was copying a sl.Mat to a numpy array. The highest the resolution, the worse the performance loss.
  • With 3.7.2, we introduce a non-deep copy of this matrix, which improved the performance greatly. Using this, python matches C++. In 3.7.4, this behaviour was set by default.

… So if you’re using the latest version of the SDK, the performance is the same between all wrappers. You’ll still have differences of performance from other sources however : driver, cuda version, operating system, etc.