Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blank time between resource loading under network inspector

I've been working on a new website and practicing my JS/jQuery/AJaxy skills. Last night I wanted to take a look at how long the page was taking to render and see if there were any areas I could clean up to increase speed. While the page loads in about 200 - 300 ms every time, I'm seeing a large amount of blank space between resource loads under the network inspector.

Chrome network inspector

http://i.imgur.com/7ng6m.jpg

Has anyone else seen this or know what I can do to minimize that time (talking about the blank space between like the html and the first css file)?

like image 570
nwalke Avatar asked Mar 19 '12 15:03

nwalke


3 Answers

Quite possibly it is caused by the extensions you have installed. AdBlock, LastPass and Google quick scroll took altogether about 200 ms on my machine.

Unfortunately, these extensions are invoked on every site and block loading the additional resources.

Try it with out of the box browser setup, the loading time will increase tremendously.

like image 66
Mikulas Dite Avatar answered Oct 16 '22 19:10

Mikulas Dite


You've got a bunch of images loaded just after the page has been loaded (the load and DOMContentLoaded events have fired - the blue and red vertical lines across the Timeline). I can see that the images are loaded by the JQuery library (the Initiator column), perhaps to build a gallery or something.

So, the case is that JQuery loads the images after the page load, presumably in the onload handler (this can look like $(document).ready(handler) in your code, but other options are possible, too).

like image 35
Alexander Pavlov Avatar answered Oct 16 '22 20:10

Alexander Pavlov


The delay between the initial page load and requesting the first resources is almost certainly caused by Chrome extensions. To find the culprit: Record a timeline in the Timeline tab in Chrome Developer Tools; Identify the scripts that are running during the Parse HTML phase; Work out which extensions they're from.

To record a timeline:

  1. Open the timeline tab and click record.
  2. Reload the page and then stop the recording. (A couple of seconds should be enough.)

To find the culprit:

  1. Find the first main Parse HTML block on the timeline. On the row below you will probably see one or more Evaluate Script blocks. These are the culprits.
  2. Click on one of the Evaluate Script blocks and find the script name in the bottom pane. Mouse-over the script name. The tooltip will have the URL of the script, which should be of the form chrome-extension://{long_identifier}/{path}
  3. Memorise the first few letters of the identifier and search for it in the chrome://extensions/ page. This tells you which extension is causing the problem. Try disabling it - you should see a difference.
  4. Repeat for the other Evaluate Script blocks.

In my case, I have 20 extensions installed but only two were causing a delay: LastPass and Fauxbar. I've chosen to leave them enabled because for me the productivity benefit of these extensions outweighs the downside of the added latency.

like image 36
simonp Avatar answered Oct 16 '22 21:10

simonp