Spreadsheet_excel_writer Speed Issues
| From: | Derrick Tan | Date: | Wed, 20 Oct 2004 03:21:57 +0000 |
| Subject: | Spreadsheet_excel_writer Speed Issues | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-14984@lists.php.net to get a copy of this message | ||
Hello,
I have a script which takes data and writes various formats etc.
There are about 40 rows x 12 or so columns written for each worksheet.
Because of the way the spreadsheet applies format objects to a
particular cell, I had to include about 35+ different formats (borders
(dotted, single, double), font size, number formats etc.). Currently
using php5.02 and the latest Spreadsheet_excel_writer package and Zend
Optimizer.
After some testing it appears that the loading of the formats is quite
fast, but writing the main data columns takes about 0.06 secs per row.
Since there are about 30 "main data" rows, that section alone takes
1.8 secs to write. All of the data is retrieved from the db before
hand, and the section mainly consists of a few simple additions and
approx 30 x 11 or so write calls.
So in all it takes around 2 secs to build the data for one sheet. Now
given that I the application requires as many as 50 or so to be
dynamically created, the function becomes almost unusable. . .waaayyyy
too slow.
I took a look at the internals of the spreadsheet class and saw that
everything is saved temporarily and written out at the end. I assume
the data must be written in some sequential ordering. . . I disabled
the tmp file in the _initialize() function to no avail. =(
My question is. . .is there any particular way to improve the speed
that is not listed in the api somewhere. Any recommendations on how
to create a spreadsheet with a little more "zip"??
Thanks,
dtan
PS. The data can be written to a pdf file with FPDF in a fraction of
the time. . .I just need to be able to edit the data properly