9

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

https://i.stack.imgur.com/8Jhqn.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)?

nwalke
  • 3,170
  • 6
  • 35
  • 60

3 Answers3

6

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.

Mikulas Dite
  • 7,790
  • 9
  • 59
  • 99
1

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.

simonp
  • 2,827
  • 1
  • 14
  • 19
1

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).

Alexander Pavlov
  • 31,598
  • 5
  • 67
  • 93
  • 1
    My question was more aimed at the time between the first html fetch and the css fetch. There seems to be 100ms or so where it does nothing (or this is just how long Chrome takes for it parse and render). – nwalke Mar 21 '12 at 20:24
  • 1
    Oh, got it... Yes, since the initator for index.css is **Parser**, you are seeing a fair amount of delay due to the main resource parsing. Could it be the case that you have one or more inline ` – Alexander Pavlov Mar 21 '12 at 22:24
  • index.css is the first thing loaded in head after the title. All the js files follow that. – nwalke Mar 22 '12 at 00:59
  • Hmm. Then you should really record a timeline as suggested by loislo, to identify the culprit. – Alexander Pavlov Mar 22 '12 at 07:20