Skip to content

Instantly share code, notes, and snippets.

@asaokamei
Created August 19, 2013 07:15
Show Gist options
  • Save asaokamei/6266426 to your computer and use it in GitHub Desktop.
Save asaokamei/6266426 to your computer and use it in GitHub Desktop.
モデル、ページオブジェクトのキャッシュ効果測定

モデル、ページオブジェクト

BEAR.Sundayで覚えたアプリオブジェクト全部をキャッシュ(APC)する荒業。 その効果についてxdebugのprofileで効果を測定。

結果

Response/Moduleのinstantiateメソード内で、生成するオブジェクトを変更して、プロファイルをチェック。

  1. 何も生成しない:118msec
  2. モデルのみ生成: 75msec
  3. モデルとページ: 73msec

知見

モデルの生成は重い。

CSVのパースとプロパティの設定。Queryなどの大量のオブジェクトの注入。

モデルはキャッシュすべし。

その他のオブジェクトは、測定しつつ決定すること。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment