Why matlab is fast in matrix multiplication
Why matlab is fast in matrix multiplication
(OP)
Does anybody know how matlab handle the matrix multiplication? I tested with 2 200-square matrices(elements are from uniform distribution of (0,1) and found out the calculation times as follows:
matlab : 0.016
fortran: 0.425
VC : 0.195
VB : 1.998
The speed is so fast. it must have used some memory optimization. Anybody know some detail about this?
Thx
matlab : 0.016
fortran: 0.425
VC : 0.195
VB : 1.998
The speed is so fast. it must have used some memory optimization. Anybody know some detail about this?
Thx





RE: Why matlab is fast in matrix multiplication
As for speed, presumably, the Matlab code is both optimized and possibly written in assembler.
Unless you were the optimizer, it's unlikely that you're comparing apples to apples. One critical optimization is to make sure that matrix indexing occurs quickly, going against the grain can sloooooow down matrix math substantially.
TTFN