Cell-Preallocation slows down code
이전 댓글 표시
I have an object containing two cell-Arrays. I know the number of rows but I can only estimate the column-size.
When preallocation the cell-Array (which will contain only chars afterwards), I get way slower code, which I don't understand:
- No Preallocation: 0.4ms per Insertion
- Row Preallocation: 9.8 ms
- Row Preallocation and Estimation of Columns: 95.0 ms
I didn't finish my code, so perhaps the speedup comes at the end? I cannot explain this strange behaviour...
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!