Spot the web RSS 2.0
# Monday, January 14, 2008

Optimizing Symbol Resolution

How to speed up in a late binding world. Discusses the scope chain from vars to the DOM itself, and how to make sure that you don’t keep running around the chain.

JavaScript Code Inefficiencies

To make string manipulation more effience in IE:

  • Use local vars
  • Cache strings from IE objects
  • Use Array.join for concatenation

(I prefict that array.join will stick around even when it isn’t faster, just like the equivilent in Java land).

Some other thoughts:

  • Don’t use eval unless you really have too. Instead of parameterized code
  • SWITCH is costly for large sets, consider a hash table wrapped in a try/catch
  • WITH is costly due to symbol lookups everywhere, use manual iterators
  • Don’t use your own get/set accessors

IE Performance Considerations

DOM is expensive in IE, especially due to the generic nature of the platform. Also watch out for layout improvements such as hover CSS style.

HTTP Performance

Simplify and reduce:

  • Script in on JS file
  • Styles in one CSS file
  • Fewer, smaller, unscaled images
  • Simplify layout
  • Use HTTP compression (lots of detail on cache control)

Tools and Techniques

  • Developer Toolbar
  • Fiddler: HTTP traffic watching
  • Ajax View: New from MS Research. On the fly rewrite the JavaScript and add instrumentation code.
Monday, January 14, 2008 4:41:00 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [0] - Trackback
Web 2.0 | AJAX
Comments are closed.
Navigation
Archive
<July 2010>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Guy Levin
Sign In
Statistics
Total Posts: 63
This Year: 0
This Month: 0
This Week: 0
Comments: 14
Themes
All Content © 2010, Guy Levin