Jump to content

PhpExcel Performance


kickstart

Recommended Posts

Hi

 

Any tricks to improve the performance of PhpExcel?

 

We have a requirement to read in several spreadsheets and add the contents to a master spreadsheet and save that out.

 

I knocked up a quick trial using PhpExcel to read a couple of spreadsheets (2 copies of the same sheet) and then try and update a 3rd. The spreadsheets are not that big (3 worksheets, main worksheet has about 65 columns and about 230 rows, about 153kb when saved to disk).

 

However it appears to take about 12 seconds just to open a spreadsheet, without doing any processing. This is timing out with just 2 spreadsheets to merge (will be at least 6 for the real application), and while I could increase the time it would land up being pretty unuseable. Once opened it runs along pretty rapidly (reading from one sheet and inserting into another at about 2000 cells a second).

 

I might be missing something obvious (I have never used PhpExcel before this), but I can't see anything mentioned about this kind of delay anywhere.

 

	$objReader = new PHPExcel_Reader_Excel2007();
	$objPHPExcel = $objReader->load($file);
	$objPHPExcel->setActiveSheetIndex(1);    // Would rather use the sheet name
	$objWorksheet = $objPHPExcel->getActiveSheet();

 

Makes no real difference if I only load the worksheet I am interested in

 

	$objReader = new PHPExcel_Reader_Excel2007();
	$objReader->setLoadSheetsOnly( array("Overview") );
	$objPHPExcel = $objReader->load($file);
	$objPHPExcel->setActiveSheetIndex(0);    // Would rather use the sheet name
	$objWorksheet = $objPHPExcel->getActiveSheet();

 

All the best

 

Keith

Link to comment
https://forums.phpfreaks.com/topic/183580-phpexcel-performance/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.