|
I created an object containing two cell-Arrays. These cell-Arrays will be filled with file contents. I do know how many rows the cell results in, however I can only estimate the columns.
As I read in the help topics, preallocation could speed up my code. So I tried it and these are the results after profiling during the data insertion
Without preallocation: 0.4 ms
With row-preallocation: 9 ms
With row and estimated column-preallocation: 95 ms
How is this even possible? I'd like to optimize my code further. I could even assign the datatype for the cell-Array (char) - can I use this information?
|