MATLAB Answers

2

MEX function is slower than matlab script. Profiling possiblilites?

Asked by Jan Kappen on 27 Jul 2014
Hey guys. I am working on a toolbox for realtime classification of driving situations. For this purpose I train a least squares SVM, see LS SVM. This one does rely heavily on solving linear systems in realtively highdimensional space (matrices about 200x40). I need to make a crossvalidation to ensure there is no overfitting, so I need to calculate the whole model a lot of times.
Now there is the problem, that the normal script version is about 3 times faster than the generated mex code (it was quite hard to make the whole thing capable for code generation...). Especially, if the dimension grow. The code should be vectorized well, so I think this is the "problem" for the c code?
I've disabled memory integrity, responsiveness to ctrl+c. May i tune the borders for dynamical memory a bit?
Or is there a way to profile the mex file, so I can see where the speeddown comes from?
Thank you very much! Jan

  0 Comments

Sign in to comment.

0 Answers