I wonder how MATLAB works with vectorized operations?
Data1 = fread(fin1, 10e6, 'uint8');
Data2 = fread(fin2, 10e6, 'uint8');
DiffA = diff(Data1);
DiffB = diff(Data2);
Does MATLAB use a kind of SIMD parallelism to execute this code? Does it use a vector processor (like a GPU) or it just using system cores (in a multicore system)?
MATLAB uses JIT to speed-up computations. I've found no explicit info on JIT, only general suggestions. In my own use cases I prefer thinking of it as Java JIT, since optimization techniques match closely. MATLAB had done 4 major steps in improving performance:
For little more details pleasee see this blog post, the comments can be really useful. The main thing I got to know is that in newer releases "clean all" removes precompiled in the session code. Yair Altman tinkered JIT and wrote a perfect book on MATLAB performance. Some details on guts and usage of MATLAB JIT are available here. For introduction on performance I'd recommend to start with official manual