When does Matlab choose to thread when using codegen and parfor
I seem to be one of few people using the Matlab coder (codegen command) to get speedup, judging by the fact that there is so little discussion or help on-line. I've gotten incredible speedups from it in some cases. I've never seen it documented, but when I make a MEX file using codegen from a Matlab script with a parfor loop, it often will thread the resulting MEX. Parfor in functions spawns multiple processes which is often less efficient than just threading (I'm inferring all this from watching top in linux and seeing multiple 100% processes in Matlab functions, but a single e.g. 1000%