IE Blog上列舉了許多針對JScript效能校調的指南。雖然有些看起來似乎沒有順應Modern JavaScript的Programming Model。Anyway, 開發JScript應用程式的人還是可以看看自己的程式碼還可以擠出多少效能。
- Symbolic Look-up Recommendations
- Evaluating Local Variables
- Cache Variables Whenever Possible
- Cache Function Pointers at all costs
- Avoid Using the ‘with’ Keyword
- JScript Code Inefficiencies
- Optimize String Manipulations by Avoiding Intermediate Results
- Running Code Using the ‘eval’ Statement is Expensive
- Requirements of Eval for JSON Expressions
- Switch Blocks are Linear Evaluation Tables
- Avoid Closures if Possible
- Don’t use Property Accessor Functions
如果你想要直接Hack JScript Garbage Collection的機制,這邊請吧。
Reference:
IE + JavaScript Performance Recommendations - Part 1
http://blogs.msdn.com/ie/archive/2006/08/28/728654.aspx
IE+JavaScript Performance Recommendations Part 2: JavaScript Code Inefficiencies
http://blogs.msdn.com/ie/archive/2006/11/16/ie-javascript-performance-recommendations-part-2-javascript-code-inefficiencies.aspx
IE+JScript Performance Recommendations Part 3: JavaScript Code Inefficiencies
http://blogs.msdn.com/ie/archive/2007/01/04/ie-jscript-performance-recommendations-part-3-javascript-code-inefficiencies.aspx
You may experience slow performance when you view a Web page that uses JScript in Internet Explorer 6
http://support.microsoft.com/?scid=kb%3Ben-us%3B919237&x=9&y=9
No comments:
Post a Comment