views:

40

answers:

1

Hi,

We are currently using PHP Spreadsheet_Excel_Writer library for generating excel sheet based reports. The library is consuming a lot of memory/time when we are trying to generate reports containing 20k-25k rows. Many times it takes above 20 sec for generating a file.

Any suggestions on which library can be used instead of Spreadsheet_excel_writer for handling large files? Any idea how PHPExcel fares with large files ?

+1  A: 

PHPExcel has problems with large files, but so do all the PHP spreadsheet libraries that I'm familiar with, both in terms of memory and performance. It's an area that has been addressed to some extent with cell caching, which reduces the typical memory requirements for each cell from around 1k/cell to 350bytes/cell, though at a cost in speed. However, using any of the writers doubles that requirement as the data to write is built up in memory. We're actively working on trying to reduce the memory requirements without adversely affecting speed of execution too much, but it's an ongoing struggle when working with large volumes of data.

Gordon has pointed you to a link referencing the alternatives to PHPExcel. The best that I can suggest is to look at all the options, and see which fulfils your actual requirements in terms of features, output formats, etc, and take into account that the PHPExcel developers are actively working on the problems of memory and speed, even if no "optimal" solution has yet been achieved; but be prepared to increase your PHP memory as necessary.

Mark Baker