Performance: Matlab vs Python
问题 I recently switched from Matlab to Python . While converting one of my lengthy codes, I was surprised to find Python being very slow. I profiled and traced the problem with one function hogging up time. This function is being called from various places in my code (being part of other functions which are recursively called). Profiler suggests that 300 calls are made to this function in both Matlab and Python . In short, following codes summarizes the issue at hand: MATLAB The class containing