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 个评论
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
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!