1.7.8 Export speed gradually slower and HUGE hit past 800 rows?

Topics: User Forum
Jun 13, 2013 at 5:47 PM
Hey there,

I am using a file and writing 90 columns to it using Excel 2007.

With a low amount of rows, say 5, it is an instant download, but the more rows I write, the slower it gets, to the point where writing 1000 rows takes like 15 minutes.

Currently from what I am testing, 300 rows are writing at 10 rows per second, while 450 rows write at 9 rows per sec, but for example, 750 does it in a bit over 8 rows per second.

However, reaching 800 rows, I suddenly hit a huge fall: it went down to 2.5 rows per second.

For 1000 rows, I didn't even calculate, but it was like 15 minutes.

Is there anything that can be done to help this? I am using different memory cache sizes but I am not sure if it does anything at all, tried from 32 to 512 and it all feels the same.

Any suggestions?
Coordinator
Jun 14, 2013 at 11:43 AM
What type of caching are you using? Any caching other than cache_in_memory will have some slowdown effect, because caching is a compromise between memory usage and speed.

Is the big slowdown in actually writing the file, or is it in setting the data in the PHPExcel object?
If the latter, are you setting each cell value individually? or using features such as the fromArray() method?
Are you using styling? Setting styles across a range of cells is faster than styling each cell individually
Jun 16, 2013 at 2:55 AM
Thanks Mark,

I was using php temp but I switched to no caching and memory gzip with the same issue, latest tests are with no caching at all.

As far as I can see, it's in writing, however what's most interesting to me is that before 800 rows (or maybe a few more) it does it relatively quickly, around 2 minutes. When trying with 1031 rows which is about 92000 cells written, it goes to 20 minutes to write the file, which is suddenly 18 minutes more for only 200 more rows.

I am writing cells individually with lines such as this in a foreach:

$objWorksheet->getCell('B'.$row)->setValue($corto['Corto']['id']);

I do use style but in a range as you recommend, and removing the styling to debug does little difference, a few seconds.
Jun 22, 2013 at 12:08 PM
Anyone got any idea of what may be happening?