How to determine what part of an AJAX application is slowing things down?

Nate

I'm writing my first AJAX driven website and some parts of it are kind of slow. For example, I'll click a button to change the page, and it might take three seconds for the new page to appear.

Chrome developer tools shows the network activity for the page being changed as follows:

DNS Lookup ​1 ms

Connecting ​45 ms

SSL ​21 ms

Sending ​0

Waiting ​1.89 s

Receiving ​73 ms

The size of the above request was 49.1 KB.

Clearly the "Waiting" time is where the slowdown is occurring. My question is, what is causing this "waiting" time? Is it something to do with the jQuery AJAX request, or is it because the MySQL database is slow, or something in a PHP file causing a delay?

Without seeing my project and debugging it first-hand, you may not be able to answer that question. If that's the case, how should I go about determining which part of the application is slowing things down?

bfavaretto

Without seeing my project and debugging it first-hand, you may not be able to answer that question. If that's the case, how should I go about determining which part of the application is slowing things down?

That depends on your debug tools. At the most basic level, comment out parts of your server-side code and check how much the "waiting" time drops.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related