Does MATLAB 2010b provide JIT acceleration support for structures and cell arrays?

1 view (last 30 days)
I have several functions and scripts that either:
- output cell arrays of vectors OR matrices - operate on cell arrays of vectors OR matrices - output on single-level structures of vectors OR matrices - operate on single-level structures of vectors OR matrices
Will the JIT be speeding up my code in any of these cases?
If I want performance enhancement will I have to rewrite my code to work with standard arrays?
  3 Comments
AJP
AJP on 4 Jun 2011
I wasn't suggesting I edit the JIT compiler! Just my own scripts and/or functions so that they could exploit it's advantages.
Walter Roberson
Walter Roberson on 4 Jun 2011
Jan meant that it was not advisable to tune your code according to the characteristics of the JIT of the version you have now, as next version the JIT might favor something else.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 4 Jun 2011
Yes, JIT will work in all of those cases.
What might turn out to have more effect, though, is the way you use the outputs. If you are going to take (say) the 5th entry of each row vector, then a matrix is more efficient to work with, but if you are going to be extracting a sublist of each row where the sublist varies across the rows, then one must keep in mind the heuristic that the less memory that has to be copied around, the faster one goes. Matters are going to depend upon how often one does the access operations... e.g., if one is going to take the output per-row multiple times then splitting by rows into cell arrays would result in faster access than repeatedly accessing rows from a matrix.
The JIT is not always the primary determiner of execution speed.
  1 Comment
AJP
AJP on 4 Jun 2011
Thanks Walter. Yes indeed there are probably hundreds of ways to speed up my code, not just exploiting JIT behaviour, but at least I'm getting some benefit from it!
Best, Adam.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!