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

1 回表示 (過去 30 日間)
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 件のコメント
AJP
AJP 2011 年 6 月 4 日
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 2011 年 6 月 4 日
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.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2011 年 6 月 4 日
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 件のコメント
AJP
AJP 2011 年 6 月 4 日
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.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by