F
F
FulgerX20072016-04-12 10:23:40
PHP
FulgerX2007, 2016-04-12 10:23:40

How to find sections of code where there is a big delay?

Hi all.
Such a situation: I take data from the database and generate an Excel report on it.
The report affects: 60,000 cells.
I load all the data with 3 queries into the database and save it to an array.
The report is generated in ~280 sec = ~ 5 min
How can I check where in my code I have the biggest delay?
Server :

  • Ubuntu 14.04 x64
  • Apache24
  • PHP7.0

Class for generating Excel files PHPExcel

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
FulgerX2007, 2016-04-12
@FulgerX2007

Thank you guys for your attention.
Solution : I removed all the styles that I created for the pages, and after that the report was generated in 9 seconds.
Decided not to bother with the design yet. Since the extra 270 seconds is a lot

A
Adamos, 2016-04-12
@Adamos

1. Make a report not in PhpExcel, but simply in HTML.
2. If it takes a long time, check the logic by inserting a microtime check.
3. When you get a quick report output, save this HTML to an XLS file and don't mess with any ugly formats.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question