3 ms·
Isn't it strange that in nearly every other optimization topic the first advice is: measure it first Yesterday my boss asked if our website feels especially sl
by krisoft 12y ago
Isn't it strange that in nearly every other optimization topic the first advice is: measure it first
Yesterday my boss asked if our website feels especially sluggish to me too. And I realized that I don't have good hard data to go by. What are the best practices to profile and monitor perceived load times?
- asolove 12y agoChrome dev tools now have an emulation mode which makes it easy to watch and measure how your page loads on different connections. Watch that on a slow connection and you can usually see the content loaded and Dom ready events as well as the progressive loading of images, fonts, js etc. Depending on how your page is structured, you will want to pick the event that best matches when the page looks usable. There are lots of tools for then getting what that event time is for your users. Google analytics and new relic's new browser features make this easy and writing your own code isn't hard. As usual, look at the numbers by percentile and not just mean.
- protonfish 12y agoI had a good experience using Pingdom.com - its free and I feel more confident having page load measured from the live server instead of simulated locally.
- acdha 12y agoUse real browsers - both with artificial testing environments like webpagetest.org and Real User Monitoring to see what your users actually experience. I won't recommend a specific RUM tool as there are a bunch of options but they all use JavaScript to get basic information and the new Navigation Timing API to get more detailed values: https://developer.mozilla.org/en-US/docs/Navigation_timing https://developer.mozilla.org/en-US/docs/Navigation_timing … and the even newer Resource Timing API: http://www.stevesouders.com/blog/2014/08/21/resource-timing-practical-tips/ http://www.stevesouders.com/blog/2014/08/21/resource-timing-... One word of caution: ignore tools like Google Analytics which are designed by the statistically ignorant. If a tool uses the mean or an average rather than a median or n-th percentile, you cannot trust it to make decisions because real-world timing data has staggering outliers – 99.999% of your users may load a resource in less than a second but the two clients which reported 2 hour load times will skew the average so much that you'll think you're seeing a problem which doesn't actually exist. I wrote about an example of this in 2012 and despite the assurances of people who work on Google Analytics and, I'm told, internal lobbying by people at Google who do understand this (e.g. Ilya Grigorik), nothing has changed in the last two years: http://chris.improbable.org/2012/5/18/google-analytics-deceptive-site-speed-report/ http://chris.improbable.org/2012/5/18/google-analytics-decep... (Yes, they do allow you to see the distribution but it hardly counts because it's a clumsy histogram to use and since you can't report on it, your boss is going to look at the averages which are displayed prominently everywhere else)