MATLAB Answers

0

2018 release: Slow xlsread

Asked by amatuercoder on 15 Jan 2019
Latest activity Answered by Ryan Jones on 7 Oct 2019
It seems that the xlsread function has slowed down considerably in the 2018 releases of MATLAB. Is this a known issue? Are there plans to improve it?

  3 Comments

Jan 15 Jan 2019
Can you post any relevant information why you think that this is a fact? How do you call xlsread? On which machine? Do you have MSOffice installed? Is the file on a local disk? What did change except for the Matlab release?
Nothing has changed other than the MATLAB release. Going from 2017b to 2018a (and continued into 2018b), it seems to take about twice as long to load data using xlsread. I know this because it is a feature that I use daily via software I wrote using the app developer. Its not like it takes 10 minutes to import the data or anything, but relative to computation using the imported data its a considerable amount of time. Currently, the importing takes about as long as the calculation itself. This was not the case in previous releases.
generally called as: A = xlsread('filename.xlsm','sheetname',range,'basic'), also called mutiple times in a row. Maybe this is what is slowing it down somehow?
Yes, MSoffice is installed
Yes, file is on a local disk
Not sure how to answer "which machine"? A high-end laptop running Windows 10?
Really I'm just curious is something was changed internal to the xlsread function that may have caused this, and if there are any plans to improve it in the future?
Jan 15 Jan 2019
The public forum has no knowledge about what MathWorks plans to modify in the future. Did you contact them already directly?
If the relative time of import and computing has changed, maybe R2018b computes much faster, while xlsread stayed at the same speed. Please clarify te details. Run some tests with importing the files under te different releases. An impression about the "relative speeds" of processing a data import does not allow to draw unique clues aboud the absolute times.

Sign in to comment.

Products


Release

R2018b

3 Answers

Guillaume
Guillaume 님의 답변 15 Jan 2019

I'm just curious is something was changed internal to the xlsread function
It's not something that can be answered by us. We're generally not told about what goes on internally at Mathworks and even if we were it would most likely be covered by a non-disclosure agreement. As Jan said, for this sort of questions you're better off asking Mathworks support directly.
I note that you use the 'basic' mode of xlsread. This mode uses an internal parser developed by mathworks (I assume), it does not rely at all on Excel to obtain the data (so whether MSoffice is installed doesn't actually matter). It's very much possible that Mathworks have made some change to that parser (probably to make it more reliable which maybe would make it slower) particularly as it looks like it will become the default mode for readtable in a future release. See the release notes about functionality change of UseExcel. But again, that's all conjecture, contact Mathworks to know for sure.

  0 Comments

Sign in to comment.


Jeremy Hughes 님의 답변 15 Jan 2019

Is this happening with all files?
You should contact MathWorks support and include an example file for which reading has slowed down.
Also, do try READTABLE with the UseExcel=false setting. For many files, this is much faster as it doesn't launch the excel process.

  0 Comments

Sign in to comment.


Ryan Jones 님의 답변 7 Oct 2019

I'm not sure why it may of slowed down, but I can say that for me it was much faster to use readtable with opts. In my case I was only reading a single cell located in the same place in many sheets.
opts = spreadsheetImportOptions('Sheet',1,'DataRange','B3:B3');%I put opts outside of my for loop
a = readtable(filetoread(i),opts,'useexcel',false);
myCellArray{i}= a.Var1{1}
vs
[~,~,tempCellArray] = xlsread(filetoread(i),1,'b3:b3','basic');
I did the above operations on 131 Files. readtable took 124s and xlsread took 716s

  0 Comments

Sign in to comment.