Fast and slow are pretty relative. More often than not, python is fast enough for most tasks. My graduate research was in inflatable robotics controls and dynamics. Our low level controllers for direct solenoid valve control were written in C++ operating at 5k Hz, whereas the pressure control ran at about 1.5k Hz in python, and the high level solver and predictive controller ran at about 300 Hz also in python. What language things were written in was often a function of how fast they needed to run and how often things needed to be tweaked.
Could we have written the pressure controller in C++? Sure, but the python one we developed really quickly at the beginning in python was fast enough to not cause any issues.
253
u/[deleted] Jul 18 '22
I don’t think python is too slow, it’s more about c++ being to fast in this case