Performance: Matlab vs C++ Matrix vector multiplication

后端 未结 2 2307
北荒
北荒 2021-02-15 18:17

Preamble

Some time ago I asked a question about performance of Matlab vs Python (Performance: Matlab vs Python). I was surprised that Matlab is faster t

2条回答
  •  闹比i
    闹比i (楼主)
    2021-02-15 18:35

    You might be interested to look at the MATLAB Central contribution mtimesx.

    Mtimesx is a mex function that optimizes matrix multiplications using the BLAS library, openMP and other methods. In my experience, when it was originally posted it could be beat stock MATLAB by 3 orders of magnitude in some cases. (Somewhat embarrassing for MATHWORKS, I presume.) These days MATLAB has improved its own methods (I suspect borrowing from this.) and the differences are less severe. MATLAB sometimes out-performs it.

提交回复
热议问题