I have been using Octave and MATLAB for a few projects, and I've come across a few questions. This question Why/when should I prefer MATLAB over Octave?) answered several, but there is still one lingering...
I've read a number of posts/other sources comparing performance of Octave and MATLAB, and I've run some of my own tests on standard scripts that confirm the general consensus that Octave is generally much slower than MATLAB for standard operations (iterated, of course, so that the comparison is meaningful).
The consensus also seems to suggest that most of MATLAB's performance boost is attributable to its JIT compiler, which compiles large loops at runtime. This makes sense, and the largest performance differences appear to occur in these cases (e.g Mathworks Matlab vs Gnu Octave)
My question is the following: why should it be the case that vectorized code also runs more slowly in Octave? It seems that in this case memory should be set aside before the loop and some native C/C++ loop should perform the operation, which would equate performance between Octave and MATLAB for vectorized code. Additionally, does this have broader implications, i.e. that Octave might perform more poorly for complex operations, even if code is written such that a JIT compiler is unneeded/unused?
question from:
https://stackoverflow.com/questions/12569351/why-is-octave-slower-than-matlab 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…