0

I have an internal website using LAMP architecture. My main page takes around 10 secs to load the data. There isn't lot of data, around 4-5k records. I dont have any complex MYSQL queries, but have a lot of them i.e. around 10-15 queries. Basically I'm extracting meta-data to display on the page. These are very simple queries. I have lot of PHP and javascript logic which is of medium complexity. I can't remove any of that. I have around 1800 lines of code in that page and I'm using datatables to display data. The datatable contains 25 columns and lot of html select elements. So how will I know what is causing performance bottleneck in this page? I tried to be as clear as possible, but please let me know if you have any questions.

Appreciate your time and help.

user1165952
  • 267
  • 1
  • 4
  • 16

2 Answers2

0

use any php profiler tool like zend profiler to see what section is taking much time

http://erichogue.ca/2011/03/linux/profiling-a-php-application/

zod
  • 12,092
  • 24
  • 70
  • 106
  • http://stackoverflow.com/questions/2145373/what-are-some-good-php-profilers-that-can-be-used – zod Mar 20 '13 at 23:37
  • Thanks Zod, I installed xdebug, but can you suggest any profiler which can be used on MAMP, because my application on localhost is using MAMP. Dev and production are in LAMP. – user1165952 Mar 21 '13 at 19:55
  • Thanks all. I used kcachegrind and figured out what the problem is. – user1165952 Apr 03 '13 at 23:28
0

Try to get all the data at once. I've had issues in the past where using multiple selects actually takes longer than more efficiently querying (also make sure you use a sql connection for as long as possible). Other than that profiling is the way to go in case your other code needs optimization.

h4unt3r
  • 846
  • 10
  • 14