MATLAB vs Python Implementation's Speed Difference
Posted: Sun Jul 29, 2018 8:19 am
Hi all,
I've been testing the difference between MATLAB and python 2.7 (cygwin) implementations of OpenSim in running forward dynamics of a human arm model. Being careful to use the same files/settings and seemingly equivalent timers in MATLAB and Python, and starting/stopping the timer directly before/after the call to run the forward tool, I've noticed that the Python implementation is notably faster than the MATLAB implementation. For example (averaged over 5 trials for accuracy), when simulating 6 seconds of a forward dynamics simulation, MATLAB takes ~150 s while python takes ~ 85 s. With 8 s, MATLAB takes ~250 s while Python takes ~140 s. That is fine, right? If so, might anyone know what the cause is?
Thank you,
Stephanie Hachem
I've been testing the difference between MATLAB and python 2.7 (cygwin) implementations of OpenSim in running forward dynamics of a human arm model. Being careful to use the same files/settings and seemingly equivalent timers in MATLAB and Python, and starting/stopping the timer directly before/after the call to run the forward tool, I've noticed that the Python implementation is notably faster than the MATLAB implementation. For example (averaged over 5 trials for accuracy), when simulating 6 seconds of a forward dynamics simulation, MATLAB takes ~150 s while python takes ~ 85 s. With 8 s, MATLAB takes ~250 s while Python takes ~140 s. That is fine, right? If so, might anyone know what the cause is?
Thank you,
Stephanie Hachem