Hi, in my latest pipeline I am suffering huge delays and along with exploring some other options to deal with that issue, one thing that came to my mind is using the C++ API instead of Python one. But it would not be as portable from host to host, so I was wondering if there's a enough of a performance benefit for me to consider switching to C++. I couldn't find any other discussions about this so would like to get some information.
C++ vs Python API
Wouldn't C++ be more portable? Once you compile it you just move the executable and run it, as long as it is the same architecture and OS. Python is a nightmare to move from system to system without cloning environments,
I don't want to make standalone executables because the code would be intertwined with other code. Overall the point of my post is to get an idea of performance difference between both the APIs. @erik would you be able to help me get an idea?
Hi PriyaJakhar28 ,
No, Python API are just bindings on top of C++ - it's exactly the same firmware/comms link as C++. Sources of delays would be something else, have you already checked https://docs.luxonis.com/projects/api/en/latest/tutorials/low-latency/ ? If so, what are the results on all the tests/checks?
For my understanding, you are saying that if I am using depthai functions/calls in C++, it's the same as using them in python? I have already checked out that link and tried all those things. I was trying to see if there are any other kinds of speed up on the host side if I switch to C++.
Hi PriyaJakhar28
Yep, that's pretty much the point of a binding, getting the best of both worlds. I think you won't see a significant difference when using python as opposed to using C++, unless you are using computationally expensive code on the host side.
Thanks,
Jaka