2018 release: Slow xlsread

7 visualizzazioni (ultimi 30 giorni)
amatuercoder
amatuercoder il 15 Gen 2019
Risposto: Ryan Jones il 7 Ott 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 Commenti
amatuercoder
amatuercoder il 15 Gen 2019
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
Jan il 15 Gen 2019
Modificato: Jan il 15 Gen 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.

Accedi per commentare.

Risposte (3)

Guillaume
Guillaume il 15 Gen 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.

Jeremy Hughes
Jeremy Hughes il 15 Gen 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.

Ryan Jones
Ryan Jones il 7 Ott 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

Categorie

Scopri di più su Startup and Shutdown in Help Center e File Exchange

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by