ios app performance tuning with instruments

11
iOS iOS Application Application Performance Tuning Performance Tuning with Instruments with Instruments 3 3 CA CA グループ合同 グループ合同 勉強会 勉強会 Shinji Hiramatsu Shinji Hiramatsu GCREST, Inc. GCREST, Inc.

Upload: gc-hiramatsu

Post on 23-Jun-2015

7.169 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: iOS App performance tuning with Instruments

iOSiOS ApplicationApplicationPerformance TuningPerformance Tuning

with Instrumentswith Instruments第第33回回 CACAグループ合同グループ合同勉強会勉強会

Shinji HiramatsuShinji Hiramatsu

GCREST, Inc.GCREST, Inc.

Page 2: iOS App performance tuning with Instruments

自己自己紹介紹介

�� 平松平松 慎司慎司 (([email protected]@gcrest.com))

�� 所属所属

株式会社ジークレスト株式会社ジークレストポータル事業部システムクリエイティブグループポータル事業部システムクリエイティブグループ

�� 普段やっていること普段やっていること@games@gamesのセルフィテーマエリアのセルフィテーマエリアクライアント全般の技術支援クライアント全般の技術支援

�� 過去の開発実績過去の開発実績

InDesignInDesign, Photoshop Elements, PageMaker, , Photoshop Elements, PageMaker,

Flash Text Layout Framework, Flash Text Layout Framework, AozoraBookselfAozoraBookself etcetc..

Page 3: iOS App performance tuning with Instruments

アジェンダアジェンダアジェンダアジェンダアジェンダアジェンダアジェンダアジェンダ

�� iOSiOSアプリアプリのパフォーマンス問題のパフォーマンス問題

�� iOSiOSアプリのメモリ管理アプリのメモリ管理

��解析ツール解析ツール InstrumentsInstruments 何ができる?何ができる?

��まとめまとめ

Page 4: iOS App performance tuning with Instruments

� 徐々に処理が重くなる

iOSiOSiOSiOSiOSiOSiOSiOSアプリアプリアプリアプリアプリアプリアプリアプリののののののののパフォーマンスパフォーマンスパフォーマンスパフォーマンス問題問題問題問題パフォーマンスパフォーマンスパフォーマンスパフォーマンス問題問題問題問題

メモリリーク等のメモリ問題

� 何かのタイミングで処理が重くなる

通信処理、Disk I/O、 重いBackground処理

� 常に重い

メインThreadで重い処理(描画or通信?)

� 起動が遅い

画像データ取得、通信 etc.

Page 5: iOS App performance tuning with Instruments

� メモリ使用の最適化

� Thread処理の最適化

� 通信処理の最適化

� ファイルI/Oの最適化

� 再描画処理の最適化

パフォーマンスチューニングパフォーマンスチューニングパフォーマンスチューニングパフォーマンスチューニングパフォーマンスチューニングパフォーマンスチューニングパフォーマンスチューニングパフォーマンスチューニング

Page 6: iOS App performance tuning with Instruments

iOSiOSiOSiOSiOSiOSiOSiOSアプリアプリアプリアプリののののメモリメモリメモリメモリ管理管理管理管理、、、、最適化最適化最適化最適化アプリアプリアプリアプリののののメモリメモリメモリメモリ管理管理管理管理、、、、最適化最適化最適化最適化

限られたメモリ内でいかに最適化できるかが鍵

� 無駄なメモリを使わない

� 使い終わったらすぐにメモリ開放する

� 起動時にまとめて確保 -> ×

� 大きなブロックのメモリ確保をなくす

→解析ツールInstrumentsを使うと効果的です。

Page 7: iOS App performance tuning with Instruments

解析解析解析解析解析解析解析解析ツールツールツールツールツールツールツールツールInstruments Instruments Instruments Instruments Instruments Instruments Instruments Instruments

Page 8: iOS App performance tuning with Instruments

� メモリリークの検出 Leaks, Zombies

� メモリの割り当て状況の確認 Allocations

� メモリの使用状況 Memory Monitor

� 仮想メモリの利用状況 VM Tracker

解析解析解析解析解析解析解析解析ツールツールツールツールツールツールツールツールInstruments Instruments Instruments Instruments Instruments Instruments Instruments Instruments

Page 9: iOS App performance tuning with Instruments

� 実行関数の処理時間、呼び出し回数の確認Sampler, Time Profiler

� CPUの利用状況 Activity Monitor, System Trace

� OpenGL ES/GPUの確認 OpenGL ES Driver

� 通信モニター Network Activity Monitor

解析解析解析解析解析解析解析解析ツールツールツールツールツールツールツールツールInstruments Instruments Instruments Instruments Instruments Instruments Instruments Instruments (Part2)(Part2)(Part2)(Part2)(Part2)(Part2)(Part2)(Part2)

Page 10: iOS App performance tuning with Instruments

�� iOSiOSアプリは、メモリ管理をしっかりと行なうことアプリは、メモリ管理をしっかりと行なうこと

が最重要。が最重要。

�� iOSiOSアプリの問題解析は、アプリの問題解析は、InstrumentsInstrumentsツールツール

が最適。頑張って使いこなしましょう!が最適。頑張って使いこなしましょう!

まとめまとめまとめまとめまとめまとめまとめまとめ

Page 11: iOS App performance tuning with Instruments

ご清聴ありがとうご清聴ありがとうございました!!ございました!!