SlideShare a Scribd company logo
Continuous Profiling for
Android Game Performance Optimization
KLab Inc.
Yoshio Hanawa
Software Engineer
KLab Inc.
Suguru Oho
Software Engineer
KLab Inc.
Sho Hosoda
Unity Engineer
KLab Inc.
KLab Inc.
About us
KLab is a Mobile gaming
company in Japan.
We have a number of games available globally
based on Japanese IPs.
Profiling on Mobile Is Painful
● No dedicated debug hardware
● Many different devices / profilers
● Troublesome to set up correctly
● Not easy for non-engineers
So we profiled on only a few devices for a limited set of cases...
Too late to notice performance degradation 
KLab Inc.
Our Solution : Continuous Profiling
● Automatic profiling integrated with CI/CD
● Non-engineers can view the analysis results on the dashboard
We can detect performance degradation sooner
and start optimizing the bottlenecks immediately
KLab Inc.
KLab Inc.
Part 1: How to Profile the Application
Scripting allows the Unity player to save profiling data in-device as a Binary Log file.
We can load and view this file in the Unity Editor using the Profiler window.
// Saves profiling data
Profiler.logFile = "mylog";
Profiler.enableBinaryLog = true;
Profiler.enabled = true;
Viewing binary log using Unity Profiler window
KLab Inc.
Summarizing Profiling Data
● We developed a Converter with Unity Technologies Japan.
● It summarize results for each Unity’s CPU main thread method.
○ processing time ( average / sum / min / max )
○ number of calls
○ call stack
Convert
Binary Log CSV
KLab Inc.
Changes to the Application for Profiling
1. Automatic app play
○ It is necessary for automatic profiling.
○ Execute a fixed scenario, such as the transition to the target scene.
2. Control start and end of profiling
○ We want to profile only the target scene.
3. Save JSON for meta information
○ Unity Version / Platform / Device Model / Scene Name / etc...
KLab Inc.
Part 2. Auto Profiling System
KLab Inc.
We can build an APK package by sending a command to a bot on Slack.
The profiling system starts automatically when the APK build is complete.
The team members don’t need to be aware of the profiling.
Build System Integration
KLab Inc.
● Python script
● AAPT (Android Asset Packaging Tool)
○ Detect Bundle ID
○ Detect main activity name
● ADB (Android Debug Bridge)
○ Install apk
○ Run application
○ Uninstall, file transfer and cleanup
● Unity (Execute convert script)
Auto-Profiling System
KLab Inc.
● Error recovery
○ Wait and retry loop is better
○ Reset ADB server (by kill-server, start-server)
○ Difference between devices and OS version
● Keep device condition clean
○ Use some ADB subcommands
■ Kill: process kill
■ Kill-all: kill all background processes
■ Pm clear: clear all data related packages
○ Wait for cooling
● Device Settings
○ Developer mode
○ “Stay awake” & Select MTP
Difficulty with REAL devices
KLab Inc.
Part 3. Dashboard System
KLab Inc.
● Services on GCP
○ Cloud Storage + Cloud Functions
■ Storing and Processing data from Android
○ BigQuery
■ Data storage for dashboard
● Google Data Studio
○ Sharing visualized analytics for team members
Dashboard System Components
KLab Inc.
● Pros
○ Lower cost than RDB
○ Almost constant performance for massive data
○ Supported by popular business intelligence tools
● Cons
○ Slower query than RDB (1-10 sec)
○ Append-only storage by design
Suitable for data analytics even if not "big data."
Pros & Cons of BigQuery
KLab Inc.
● Pros
○ Free BI tool (Thanks Google!)
○ Provides access control with Google account
● Cons
○ Limited chart type and customizability
Good enough for our dashboard
Pros & Cons of Data Studio
KLab Inc.
Top page shows
summary of multiple profiling
Dashboard Screen
KLab Inc.
Click on the drilldown link on
the top page to go this page.
● By Category
○ Breakdown pie chart
○ Checking upper limit
● By Method
○ Average frame timing
[ms]
etc...
Detailed Report
KLab Inc.
Performance Improvement Due To Optimization
KLab Inc.
● Profile and show other performance indices
○ Memory consumption
○ GPU
○ Network I/O
○ Etc.
● More stability and usability
○ Monitoring auto-profiling system
○ Web interface for controlling auto-profiling system
Future works
KLab Inc.
We developed a fully-automated profiling system for Android games.
Freed from painful manual profiling tasks
Non-engineer friendly system
As a result
We can detect bottlenecks in our games.
The iteration of performance optimization becomes faster.
Conclusion
KLab Inc.
Thank You
KLab Inc.

More Related Content

PDF
The WordPress Performance Team
PDF
Multiplication and division of calabash tests
PDF
Introduce Angular2 & render & firebase flow
PDF
디자인 시스템에 직방 ZUIX
PDF
Innovation dank DevOps (DevOpsCon Berlin 2015)
PDF
Leveraging the Power of Custom Elements in Gutenberg
PDF
AzovDevMeetup 2016 | Angular 2: обзор | Александр Шевнин
PDF
Releasing To Production Every Week
The WordPress Performance Team
Multiplication and division of calabash tests
Introduce Angular2 & render & firebase flow
디자인 시스템에 직방 ZUIX
Innovation dank DevOps (DevOpsCon Berlin 2015)
Leveraging the Power of Custom Elements in Gutenberg
AzovDevMeetup 2016 | Angular 2: обзор | Александр Шевнин
Releasing To Production Every Week

What's hot (20)

PPTX
Software Engineering in Startups
PDF
Gaas pitfall and best practices
PPTX
Branching Your Way to Low-Code Perfection
PPTX
JavaFX meetup
PDF
Morden F2E Education - Think of Progressive Web Apps
PDF
Introduction of bootstrap in angular
PPTX
2018 .NET Conf - 利用Machine Learning .NET整合機器學習至應用程式
PPTX
PDF
JAMF User Group September 2015
PDF
Web Policies & Reporting
PPTX
Scrum Day, Introducing Scrum at moreTV
PPTX
How to Be More Productive With AI Development Assistance
PDF
.Net core 與 .net standard 實戰教學 開發指南
PPTX
DevOps
PPTX
Сергей Баранов. Enterprise DevOps
PPTX
Azure Artifactsを触ってみよう
PDF
Motion design in FIori
PPTX
Programming Motherfucker
PDF
Pluggable web app using Angular (Odessa JS conf)
PPTX
Progressive Web App Testing With Cypress.io
Software Engineering in Startups
Gaas pitfall and best practices
Branching Your Way to Low-Code Perfection
JavaFX meetup
Morden F2E Education - Think of Progressive Web Apps
Introduction of bootstrap in angular
2018 .NET Conf - 利用Machine Learning .NET整合機器學習至應用程式
JAMF User Group September 2015
Web Policies & Reporting
Scrum Day, Introducing Scrum at moreTV
How to Be More Productive With AI Development Assistance
.Net core 與 .net standard 實戰教學 開發指南
DevOps
Сергей Баранов. Enterprise DevOps
Azure Artifactsを触ってみよう
Motion design in FIori
Programming Motherfucker
Pluggable web app using Angular (Odessa JS conf)
Progressive Web App Testing With Cypress.io
Ad

Similar to Continuous Profiling for Android Game Performance Optimization (9)

PPTX
How to Reliably Measure and Optimize Graphics Performance of Your Android Games
PPTX
Of Bytes, Cycles and Battery Life
PDF
Azq android presentation
PDF
Perfecting Gamer’s Experiences with Performance Testing for Gaming Applicatio...
PDF
Sensible scaling
PPTX
GIAF USA Fall 2015 - Lean analytics
PDF
Profiling Android Applications
PPTX
Mobile Analytics - Tools Of Trade to Predict the Future@Phoenix Mobile Festival
How to Reliably Measure and Optimize Graphics Performance of Your Android Games
Of Bytes, Cycles and Battery Life
Azq android presentation
Perfecting Gamer’s Experiences with Performance Testing for Gaming Applicatio...
Sensible scaling
GIAF USA Fall 2015 - Lean analytics
Profiling Android Applications
Mobile Analytics - Tools Of Trade to Predict the Future@Phoenix Mobile Festival
Ad

More from KLab Inc. / Tech (20)

PDF
【公開用】モバイルオンラインゲーム開発を支える早く、安く、使いやすいサーバインフラ構築
PDF
モバイルオンラインゲームのアプリ外課金の導入と運用方法について
PDF
デバイスファーム 「AirLab」 による 自動QAテストの実績と機械学習が拓く次世代QAの可能性
PDF
2024年5月17日 先駆的科学計算フォーラム2024 機械学習を用いた新たなゲーム体験の創出の応用
PDF
大規模モバイルオンラインゲーム開発における チーム組成とワークフロー最適化
PDF
運用中の大規模オンラインゲームで 8年ぶりにPHPバージョンアップをした話
PDF
AirLab導入でテストコストの大幅削減と品質向上! 数十台の端末を一斉に全自動テストできる社内DeviceFarmについてご紹介
PDF
生成AIが切り拓く新しいゲームの創り方・遊び方
PDF
表も裏もすべて見せます! KLab謹製大規模オンラインゲームの リアルタイムチャットマイクロサービス
PDF
モバイルオンラインゲームでの大規模観戦とチート対策 〜自社製リアルタイム通信システム「WSNet2」の事例〜
PDF
他業界からゲーム業界へ転向したときの話
PDF
KLabのゲーム開発を支える開発環境
PDF
ゲーム開発を知らない人にも分かるKLabのゲーム開発運営
PDF
「リアルISUCON」としてのモバイルオンラインゲーム開発
PDF
ゴリラテスト モバイルゲームのUIを自動的に検出・操作する モンキーテスト
PDF
モバイルアプリの高速で安定したビルドを支えるJenkins運用術
PDF
『ラブライブ!スクールアイドルフェスティバル ALL STARS』を支えるビルドパイプライン 〜より安定したサービス提供を目指して〜
PPTX
KLabのチャットシステム インフラ変遷
PPTX
Ganglia のUIにGrafanaを追加する話
PPTX
KLabのインフラエンジニア 〜 こんな感じで働いてます 〜
【公開用】モバイルオンラインゲーム開発を支える早く、安く、使いやすいサーバインフラ構築
モバイルオンラインゲームのアプリ外課金の導入と運用方法について
デバイスファーム 「AirLab」 による 自動QAテストの実績と機械学習が拓く次世代QAの可能性
2024年5月17日 先駆的科学計算フォーラム2024 機械学習を用いた新たなゲーム体験の創出の応用
大規模モバイルオンラインゲーム開発における チーム組成とワークフロー最適化
運用中の大規模オンラインゲームで 8年ぶりにPHPバージョンアップをした話
AirLab導入でテストコストの大幅削減と品質向上! 数十台の端末を一斉に全自動テストできる社内DeviceFarmについてご紹介
生成AIが切り拓く新しいゲームの創り方・遊び方
表も裏もすべて見せます! KLab謹製大規模オンラインゲームの リアルタイムチャットマイクロサービス
モバイルオンラインゲームでの大規模観戦とチート対策 〜自社製リアルタイム通信システム「WSNet2」の事例〜
他業界からゲーム業界へ転向したときの話
KLabのゲーム開発を支える開発環境
ゲーム開発を知らない人にも分かるKLabのゲーム開発運営
「リアルISUCON」としてのモバイルオンラインゲーム開発
ゴリラテスト モバイルゲームのUIを自動的に検出・操作する モンキーテスト
モバイルアプリの高速で安定したビルドを支えるJenkins運用術
『ラブライブ!スクールアイドルフェスティバル ALL STARS』を支えるビルドパイプライン 〜より安定したサービス提供を目指して〜
KLabのチャットシステム インフラ変遷
Ganglia のUIにGrafanaを追加する話
KLabのインフラエンジニア 〜 こんな感じで働いてます 〜

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation theory and applications.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Approach and Philosophy of On baking technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Spectroscopy.pptx food analysis technology
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
cuic standard and advanced reporting.pdf
Review of recent advances in non-invasive hemoglobin estimation
Encapsulation_ Review paper, used for researhc scholars
Diabetes mellitus diagnosis method based random forest with bat algorithm
Mobile App Security Testing_ A Comprehensive Guide.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Network Security Unit 5.pdf for BCA BBA.
Encapsulation theory and applications.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Approach and Philosophy of On baking technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Understanding_Digital_Forensics_Presentation.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Spectroscopy.pptx food analysis technology
NewMind AI Weekly Chronicles - August'25 Week I
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
“AI and Expert System Decision Support & Business Intelligence Systems”

Continuous Profiling for Android Game Performance Optimization

  • 1. Continuous Profiling for Android Game Performance Optimization KLab Inc. Yoshio Hanawa Software Engineer KLab Inc. Suguru Oho Software Engineer KLab Inc. Sho Hosoda Unity Engineer KLab Inc. KLab Inc.
  • 2. About us KLab is a Mobile gaming company in Japan. We have a number of games available globally based on Japanese IPs.
  • 3. Profiling on Mobile Is Painful ● No dedicated debug hardware ● Many different devices / profilers ● Troublesome to set up correctly ● Not easy for non-engineers So we profiled on only a few devices for a limited set of cases... Too late to notice performance degradation  KLab Inc.
  • 4. Our Solution : Continuous Profiling ● Automatic profiling integrated with CI/CD ● Non-engineers can view the analysis results on the dashboard We can detect performance degradation sooner and start optimizing the bottlenecks immediately KLab Inc.
  • 6. Part 1: How to Profile the Application Scripting allows the Unity player to save profiling data in-device as a Binary Log file. We can load and view this file in the Unity Editor using the Profiler window. // Saves profiling data Profiler.logFile = "mylog"; Profiler.enableBinaryLog = true; Profiler.enabled = true; Viewing binary log using Unity Profiler window KLab Inc.
  • 7. Summarizing Profiling Data ● We developed a Converter with Unity Technologies Japan. ● It summarize results for each Unity’s CPU main thread method. ○ processing time ( average / sum / min / max ) ○ number of calls ○ call stack Convert Binary Log CSV KLab Inc.
  • 8. Changes to the Application for Profiling 1. Automatic app play ○ It is necessary for automatic profiling. ○ Execute a fixed scenario, such as the transition to the target scene. 2. Control start and end of profiling ○ We want to profile only the target scene. 3. Save JSON for meta information ○ Unity Version / Platform / Device Model / Scene Name / etc... KLab Inc.
  • 9. Part 2. Auto Profiling System KLab Inc.
  • 10. We can build an APK package by sending a command to a bot on Slack. The profiling system starts automatically when the APK build is complete. The team members don’t need to be aware of the profiling. Build System Integration KLab Inc.
  • 11. ● Python script ● AAPT (Android Asset Packaging Tool) ○ Detect Bundle ID ○ Detect main activity name ● ADB (Android Debug Bridge) ○ Install apk ○ Run application ○ Uninstall, file transfer and cleanup ● Unity (Execute convert script) Auto-Profiling System KLab Inc.
  • 12. ● Error recovery ○ Wait and retry loop is better ○ Reset ADB server (by kill-server, start-server) ○ Difference between devices and OS version ● Keep device condition clean ○ Use some ADB subcommands ■ Kill: process kill ■ Kill-all: kill all background processes ■ Pm clear: clear all data related packages ○ Wait for cooling ● Device Settings ○ Developer mode ○ “Stay awake” & Select MTP Difficulty with REAL devices KLab Inc.
  • 13. Part 3. Dashboard System KLab Inc.
  • 14. ● Services on GCP ○ Cloud Storage + Cloud Functions ■ Storing and Processing data from Android ○ BigQuery ■ Data storage for dashboard ● Google Data Studio ○ Sharing visualized analytics for team members Dashboard System Components KLab Inc.
  • 15. ● Pros ○ Lower cost than RDB ○ Almost constant performance for massive data ○ Supported by popular business intelligence tools ● Cons ○ Slower query than RDB (1-10 sec) ○ Append-only storage by design Suitable for data analytics even if not "big data." Pros & Cons of BigQuery KLab Inc.
  • 16. ● Pros ○ Free BI tool (Thanks Google!) ○ Provides access control with Google account ● Cons ○ Limited chart type and customizability Good enough for our dashboard Pros & Cons of Data Studio KLab Inc.
  • 17. Top page shows summary of multiple profiling Dashboard Screen KLab Inc.
  • 18. Click on the drilldown link on the top page to go this page. ● By Category ○ Breakdown pie chart ○ Checking upper limit ● By Method ○ Average frame timing [ms] etc... Detailed Report KLab Inc.
  • 19. Performance Improvement Due To Optimization KLab Inc.
  • 20. ● Profile and show other performance indices ○ Memory consumption ○ GPU ○ Network I/O ○ Etc. ● More stability and usability ○ Monitoring auto-profiling system ○ Web interface for controlling auto-profiling system Future works KLab Inc.
  • 21. We developed a fully-automated profiling system for Android games. Freed from painful manual profiling tasks Non-engineer friendly system As a result We can detect bottlenecks in our games. The iteration of performance optimization becomes faster. Conclusion KLab Inc.