Microsoft IE JavaScript Perf. Tips, Part Trois
Written by on January 5th, 2007 in Ajax News.
In August and November, we highlighted parts one and two of the IE team’s JScript performance tips. Peter Gurevich is back for part three:
- Avoid Closures if Possible. What happens when [a closure registered as an event listener] never fires? We expect it to, but it might not. If it doesn’t fire, the closure [may have] a reference to [a] source object and the source object back to the closure. This is an implicit circular reference, hard to spot, and IE leaks memory. This is never good for performance.
- Don’t use Property Accessor Functions. A common technique in object oriented programming is to use property accessor functions… in the form of [get/set]_PropertyName (or many others depending on the style)… [This makes for] terrible JScript.
Source: Ajaxian
Original Article: http://ajaxian.com/archives/microsoft-ie-javascript-perf-tips-part-trois