title: Why is Octave slower than MATLAB?
body: <p>I have been using Octave and MATLAB for a few projects, and I've come across a few questions. This question <a href="https://stackoverflow.com/questions/3534867/why-when-should-i-prefer-matlab-over-octave">Why/when should I prefer MATLAB over Octave?</a>) answered several, but there is still one lingering...</p>
  
  <p>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).</p>
  
  <p>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 <a href="http://thatcadguy.blogspot.fr/2011/01/mathworks-matlab-vs-gnu-octave.html" rel="noreferrer">Mathworks Matlab vs Gnu Octave</a>)</p>
  
  <p>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?</p>