Can PHPExcel be very slow at times? What factors contribute to its slowness?

Topics: User Forum
May 24, 2013 at 7:47 PM
I'm using PHPExcel 1.7.8 on PHP 5.4.14 on Windows 7 (dev environment). I'm trying to import a semi-large spreadsheet (about 609KB). It has 750 rows and the columns go to BW. All I'm doing is reading data from an Excel 2007 spreadsheet. I've executed my script a number of times and discovered it takes a very long time for PHPExcel to load/read the spreadsheet. This last time I ran it, I timed it. It took 32 minutes. I need to loop through multiple rows, but I'm only going through a single row at the moment. Is it typical for it to take this long? It just seems too long to be normal.
May 24, 2013 at 9:35 PM
PHPExcel isn't fast, but it shouldn't take over 30 minutes to load a spreadsheet of that size.... my own performance tests are run against spreadsheets several times that size loading in less than a minute, so clearly there is something very wrong here. If possible, can you upload a sample spreadsheet so that I can try and identify what is going wrong.
Jul 5, 2013 at 11:41 PM
I have a .xls spreadsheet with one worksheet containing 21 rows and 9 columns. I've used CTRL-END to see if there's any hidden data and it only moves the active cell from A1 to I21, so 21x9 is all there is in this 18.5Kb .xls file. This takes approximately 35 minutes for my fast server to execute the following 3 statements :
// using PHPExcel-1.7.8 with PHP 5.4.16 on Centos 5 on quad code xeon dedicated server with 16GB RAM
$objPHPExcel = PHPExcel_IOFactory::createReaderForFile($path_to_excel);
Is there anything else I should be doing?
Jul 6, 2013 at 12:12 AM
An impossible to answer question: There's something severely wrong here, because it should barely take seconds to load that spreadsheet file on any halfway decent server; but I can't explain why it's taking in excess of half an hour.
I run tests with significantly larger workbooks (multiple worksheets with 1000s of rows and dozens of columns) than that on a far less powerful machine, and get concerned if it takes longer than a minute.
PHPExcel isn't fast, but that's pretty extreme (it should take perhaps 1/100th of that time), suggesting that there's something else going on that's hammering your CPU, or disk or using all your memory.