October 2009
4 posts
JavaScript のスピードアップ (Google Tech Talk)
最近 Google Tech Talk の Speed Up Your JavaScript を見たので、 今後のためにメモしておく。
Nicholas C. Zakas さんがプレゼンテーションの中で次の4つの点について説明している。
スコープ管理
データアクセス
ループ
DOM
スコープ管理
ローカル変数を使う (変数などはローカル変数に保存して使う)
“with” ステートメントをさける。また “try-catch” を使う時は注意 (これらはスコープチェインの先頭にオブジェクトを追加する)
#1の例: ローカル変数を使用
function func1(){
var doc = document;
var header = doc.getElementById('header');
...
Speed up your JavaScript (Google Tech Talk)
I watched Google Tech Talk Video - Speed Up Your JavaScript yesterday. I take a note of some points of the technic here for my study.
Nicholas C. Zakas showed 4 points for speed up in the presentation.
Scope Management
Data access
Loops
DOM
Scope Management
Use Local Valiables. (Store a valiable to a local valiable.)
Avoid “with” statement. Be careful...
via 10/GUI | Blog | Nick Finck | UX/IA Pro, Speaker, and Community Cultivator.
実現すべきなのは、ひとりが使い始めたら、周りはまったく何もしなくても、当人とその友だち全員の役に立つ仕掛けだ。
– jwz: グループウェア、ダメ! ‐ Groupware Bad
(original sentence)
The trick you want to accomplish is that when one person is using your software, it suddenly provides value to that person and their entire circle of friends, without the friends having had to do anything at all.