Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There are a lot of things that can go wrong during the entire span of the request.</p> <p>Here are a few notable areas you could check for bottlenecks, starting from the request to the response.</p> <ul> <li><p><strong>Is your browser/system/hardware capable?</strong></p> <p>Since this operation is JavaScript, older browsers like IE6, low-powered systems like netbooks and even weakly set-up systems which run too many applications at a given time may suffer the consequences.</p></li> <li><p><strong>Is the browser instantly executing the task? Or was it delayed?</strong></p> <p>Busy JavaScript is the culprit here. JavaScript is single-threaded and too many operations can and will bog down the browser and may delay queued tasks from running. An example of a scenario which can make this happen is when your page contains too many JavaScript plugins, or contain code that is poorly coded, some of which might even use synchronous operations.</p></li> <li><p><strong>Could it be the PHP/JSP/[some other server-side language]?</strong></p> <p>Yes it could be. For example, PHP might be threaded per request but the operation of it's code is synchronous. If a line of PHP takes too long to execute, this comprises part of that delay. Until that line finishes, the server will never respond.</p></li> <li><p><strong>Do you use multiple/nested SQL queries?</strong></p> <p>Diving deeper into the server, multiple and/or nested SQL queries, especially for a commonly used operation can and will cause further delay. An advice is to limit your query only to what was supposed to be fetched, and not entire records. If nested queries can't be avoided, try a different method of retrieving that data.</p></li> <li><p><strong>Unoptimized function calls</strong></p> <p>This goes for both server-side and client-side scripts. Excessive operations could also be the cause of delays. Determine code that is excessively redundant and merge/shorten them. In JS, for example, simple condition-assignment operations can be done with ternary operations.</p></li> <li><p><strong>Looping too much?</strong></p> <p>Looping too much is also one common cause of delays. One mistake in SQL is to retrieve all rows and count them in PHP instead of using the built-in <code>COUNT()</code> in SQL. The error is two-fold, you return too much data from SQL, and second you are counting/looping over too many items in PHP.</p></li> <li><p><strong>Are you on dial-up or what?</strong></p> <p>Bandwidth is essential, hence size matters. And so, limit your return data only to what was needed. The main reason developers prefer JSON was it's smaller size compared to XML as well as marked-up content. To add to that, you can also compress your return data with gzip compression.</p></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload