Improving Web Frontend Performance
Author Alex Ciminian
2011-09-21 14:00
Author Alex Ciminian
2011-09-21 14:00
Research on a wide variety of hypertext systems has shown that users need response times of less than one second when moving from one page to another if they are to navigate freely through an information space.
The page with 10 results took .4 seconds to generate. The page with 30 results took .9 seconds. Half a second delay caused a 20% drop in traffic. Half a second delay killed user satisfaction.
Accept-Encoding: gzip, deflate
Vary: Accept-Encoding Content-Encoding: gzip
Last-Modified: Wed, Sep 01 2011 00:00:00 GMT
If-Modified-Since: Sep 13 2011
ETag: bada55
If-None-Match: bada55
Expires: Tue, 20 Mar 2007 04:00:25 GMT
Cache-Control: max-age=3600
function createChildFor(elementId){
var doc = document, //store in a local variable
element = doc.getElementById(elementId),
newElement = doc.createElement("div");
element.appendChild(newElement);
}
with
and
catch
augment the scope chain
HTMLCollection
is a live query
if
for no more than two values to test or ranges
switch
for up to ten values to test
arrays
for over ten values which have single values as results
indexOf
over arrays can be much slower than a loop
[].join()
was preferred.
setTimeout(func, 0)
provides access to the events stack.
Steve Souders: High Performance Websites
Steve Souders:
Even Faster Websites
Performance bookmarklets?