SlideShare uma empresa Scribd logo
1 de 36
Advanced Mobile Optimizations How to go to 60 fps after you have removed all Sleep calls ;-)
Disclaimer The views expressed here are my personal views and do not necessarily reflect the thoughts, opinions, intentions, plans or strategies of  Unity
Optimization Mindset you can't just make your game faster there is no magic bullet very specific stuff not the same as scripting charachter
Optimization Mindset not in specific order know think measure
Optimization Mindset You can't avoid any of that no, really
Optimization Mindset know + think = shoot in the dark you just write code hoping for the best know + measure = shoot in the dark you are missing "understand" part think + measure = shoot in the dark you solve abstract problem, not real
Optimization Mindset: know + think hardware is more complex then you think highly parallel deep pipelining when you write asm - high-level already
Optimization Mindset: know + measure knowledge is static knowledge comes from the past knowledge is general
Optimization Mindset: know + measure qsort vs bubble sort sure, qsort is faster but you are missing the point maybe radix? maybe no need to sort? maybe insertion? parallel sorting network?
Optimization Mindset: think + measure solving abstract problem example: GPU optimizing for RIVA TNT and GTX is different
Optimization Mindset well, if you are missing two from the three no comments
Know your hardware your data knowing data is interleaved with think we will talk more of it in "think"
Know your hardware GPU CPU whatever e.g. disk load speed
Know your hardware: GPU Pipeline meaning - slow step = slow everything you are as slow as your bottleneck Know your pipeline Won't go into full pipeline spec Resources section Just common/biggest problems
Know your hardware: GPU Geometry pre/post tnl cache should use indexed geometry or not cache hit rate  strips vs tri list memory throughput vertex size fetch cost (memory) pack attributes or not
Know your hardware: GPU Textures Texture Cache swizzle compression mip-maps Biggest memory hog
Know your hardware: GPU Shaders VertexProgram vs FragmentShader balancing attributes Unified Shaders load balancing Precision gles: highp/mediump/lowp CG: float/half/fixed (iirc)
Know your hardware: GPU Rasterization Fillrate (memory speed) alpha 2x2 samples (or more) why GometryLOD matters
Know your hardware: CPU Mobile = in-order RISC for stupid code far worse than CISC     2 main issues: Memory speed Computation speed
Know your hardware: CPU Memory This is single most important factor memory access far slower then computation Latency vs Throughput Caches fast memory your best friend L1/L2/whatever LHS
Know your hardware: CPU Computations SIMD better memory usage better arithmetic usage (4 vals instead of 1)
Know your target hardware There were general rules But you are running on that particular piece of sh... hardware
Know your target hardware: PowerVR TBDR perfect hidden surface removal Alpha-Test/discard shader precision  unified shaders Tegra / ATI-AMD / Adreno more common
Know your target hardware: ARM VFP = FPU on steroids (not real SIMD) scalar instructions at same speed as vectorized NEON = SIMD more registers awesome load/store instructions not as cool as Altivec but cool enough for mobiles
Know your target hardware: ARM Conditional execution of most instructions Fold shifts and rotates into the "data processing" instructions load structure from array by index Thumb + float = disaster switch back and forth between Thumb mode and regular 32-bit mode
Know your hardware: Resources RTR lots of whitepapers: powerVR (imgtech) tegra (nvidia) adreno (qualcomm) AMD/ATI - basically the same as X360, but much smaller tiles ARM dev center
Think Think about your data Think about your algorithms Think about your constraints Think about your hardware
Think Basics CPU vs GPU e.g. draw calls  pure CPU cost CPU: memory vs arithmetic memory slower GPU: vprog vs fshader memory vs arithmetic
Think Memory fragmentation data organization AOS vs SOA  hot/cold split data structures linear vs random  array vs list  map vs hashtable  allocators
Think Constraints GPU: will you see the difference? really? on mobile screen? on that one small thingy in the corner? CPU: will you need that? e.g. physics in casual game? Memory: will you need that? will you need more then XXX actors?
Measure you didn't optimize anything if you didn't measure difference you can't optimize if you don't know what needs to be optimized if you can't measure what takes time
Measure Tools there are lots of tools  instruments (ios) perfhud (tegra) adreno profiler (qualcomm) some more probably Poor-man profiler timers
Unity use case:random bits Mobile shaders specialized of usual built-ins Skinning full NEON/VFP impl usually 10-15% of c-code time and we are not done optimizing it ;-) Rej's baking material to texture and coming soon BRDF baking to texture
Unity use case:random bits Remote Profiler run on target hw, data is transferred over wifi collect in Editor and show pretty graphs ;-) Sort alpha-test *after* opaque check *lots* of extensions LODs - almost done Vertex Cache optimization - after LODs ;-)
Closing Words	 Know hardware Know data Think data Think constraints Measure always You better know earlier You should be always optimizing
Questions

Mais conteúdo relacionado

Semelhante a Advanced Mobile Optimizations

Parts of Computer
Parts of ComputerParts of Computer
Parts of Computermegaurab
 
Build your dream custom pc(blog)
Build your dream custom pc(blog)Build your dream custom pc(blog)
Build your dream custom pc(blog)UmarChaudhry17
 
infoShare AI Roadshow 2018 - Tomasz Kopacz (Microsoft) - jakie możliwości daj...
infoShare AI Roadshow 2018 - Tomasz Kopacz (Microsoft) - jakie możliwości daj...infoShare AI Roadshow 2018 - Tomasz Kopacz (Microsoft) - jakie możliwości daj...
infoShare AI Roadshow 2018 - Tomasz Kopacz (Microsoft) - jakie możliwości daj...Infoshare
 
Scalable data systems at Traveloka
Scalable data systems at TravelokaScalable data systems at Traveloka
Scalable data systems at TravelokaRendy Bambang Junior
 
Computer systems|Computer Networking & Communication System Assignment - Netw...
Computer systems|Computer Networking & Communication System Assignment - Netw...Computer systems|Computer Networking & Communication System Assignment - Netw...
Computer systems|Computer Networking & Communication System Assignment - Netw...freeassignmenthelp
 
Buying Your Next Computer
Buying Your Next ComputerBuying Your Next Computer
Buying Your Next ComputerLeslie Eyton
 
High Availability in 37 Easy Steps
High Availability in 37 Easy StepsHigh Availability in 37 Easy Steps
High Availability in 37 Easy StepsTim Serong
 
Tugas b.inggris
Tugas b.inggrisTugas b.inggris
Tugas b.inggrisGus Sani
 
Topics - , Addressing modes, GPU, .pdf
Topics - , Addressing modes, GPU,  .pdfTopics - , Addressing modes, GPU,  .pdf
Topics - , Addressing modes, GPU, .pdfShubhamSinghRajput46
 
Multimedia hardware
Multimedia hardwareMultimedia hardware
Multimedia hardwareUtsav Roy
 
MongoDB & Machine Learning
MongoDB & Machine LearningMongoDB & Machine Learning
MongoDB & Machine LearningTom Maiaroto
 
Data oriented design and c++
Data oriented design and c++Data oriented design and c++
Data oriented design and c++Mike Acton
 
AI Chip Trends and Forecast
AI Chip Trends and ForecastAI Chip Trends and Forecast
AI Chip Trends and ForecastCastLabKAIST
 
Java Tools and Techniques for Solving Tricky Problem
Java Tools and Techniques for Solving Tricky ProblemJava Tools and Techniques for Solving Tricky Problem
Java Tools and Techniques for Solving Tricky ProblemWill Iverson
 
Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...
Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...
Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...Intel® Software
 

Semelhante a Advanced Mobile Optimizations (20)

Parts of Computer
Parts of ComputerParts of Computer
Parts of Computer
 
Why you need game engine1.pptx
Why you need game engine1.pptxWhy you need game engine1.pptx
Why you need game engine1.pptx
 
Build your dream custom pc(blog)
Build your dream custom pc(blog)Build your dream custom pc(blog)
Build your dream custom pc(blog)
 
infoShare AI Roadshow 2018 - Tomasz Kopacz (Microsoft) - jakie możliwości daj...
infoShare AI Roadshow 2018 - Tomasz Kopacz (Microsoft) - jakie możliwości daj...infoShare AI Roadshow 2018 - Tomasz Kopacz (Microsoft) - jakie możliwości daj...
infoShare AI Roadshow 2018 - Tomasz Kopacz (Microsoft) - jakie możliwości daj...
 
Scalable data systems at Traveloka
Scalable data systems at TravelokaScalable data systems at Traveloka
Scalable data systems at Traveloka
 
Computer systems|Computer Networking & Communication System Assignment - Netw...
Computer systems|Computer Networking & Communication System Assignment - Netw...Computer systems|Computer Networking & Communication System Assignment - Netw...
Computer systems|Computer Networking & Communication System Assignment - Netw...
 
Class 1.
Class 1.Class 1.
Class 1.
 
Buying Your Next Computer
Buying Your Next ComputerBuying Your Next Computer
Buying Your Next Computer
 
High Availability in 37 Easy Steps
High Availability in 37 Easy StepsHigh Availability in 37 Easy Steps
High Availability in 37 Easy Steps
 
Cuda cracking
Cuda crackingCuda cracking
Cuda cracking
 
Tugas b.inggris
Tugas b.inggrisTugas b.inggris
Tugas b.inggris
 
Topics - , Addressing modes, GPU, .pdf
Topics - , Addressing modes, GPU,  .pdfTopics - , Addressing modes, GPU,  .pdf
Topics - , Addressing modes, GPU, .pdf
 
Multimedia hardware
Multimedia hardwareMultimedia hardware
Multimedia hardware
 
HEC-RAS_para ingenieras en Gestion de Riesgos
HEC-RAS_para ingenieras en Gestion de RiesgosHEC-RAS_para ingenieras en Gestion de Riesgos
HEC-RAS_para ingenieras en Gestion de Riesgos
 
MongoDB & Machine Learning
MongoDB & Machine LearningMongoDB & Machine Learning
MongoDB & Machine Learning
 
Data oriented design and c++
Data oriented design and c++Data oriented design and c++
Data oriented design and c++
 
AI Chip Trends and Forecast
AI Chip Trends and ForecastAI Chip Trends and Forecast
AI Chip Trends and Forecast
 
Java Tools and Techniques for Solving Tricky Problem
Java Tools and Techniques for Solving Tricky ProblemJava Tools and Techniques for Solving Tricky Problem
Java Tools and Techniques for Solving Tricky Problem
 
Computer components
Computer componentsComputer components
Computer components
 
Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...
Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...
Scale CPU Experiences: Maximize Unity* Performance Using the Entity Component...
 

Mais de Транслируем.бел

Руководство по видео, трансляциям и премьерам (Youtube 2020)
Руководство по видео, трансляциям и премьерам (Youtube 2020)Руководство по видео, трансляциям и премьерам (Youtube 2020)
Руководство по видео, трансляциям и премьерам (Youtube 2020)Транслируем.бел
 
Корпоративный новый год онлайн
Корпоративный новый год онлайнКорпоративный новый год онлайн
Корпоративный новый год онлайнТранслируем.бел
 
Руководство для малого и среднего бизнеса по использованию цифровых решений
Руководство для малого и среднего бизнеса по использованию цифровых решенийРуководство для малого и среднего бизнеса по использованию цифровых решений
Руководство для малого и среднего бизнеса по использованию цифровых решенийТранслируем.бел
 
Онлайн-трансляции в соцсетях
Онлайн-трансляции в соцсетяхОнлайн-трансляции в соцсетях
Онлайн-трансляции в соцсетяхТранслируем.бел
 
Как организовать трансляцию в Facebook
Как организовать трансляцию в FacebookКак организовать трансляцию в Facebook
Как организовать трансляцию в FacebookТранслируем.бел
 
Что сделать, чтобы сто раз все не переделывать
Что сделать, чтобы сто раз все не переделыватьЧто сделать, чтобы сто раз все не переделывать
Что сделать, чтобы сто раз все не переделыватьТранслируем.бел
 
Когда сказать нет. Арсений Кравченко
Когда сказать нет. Арсений КравченкоКогда сказать нет. Арсений Кравченко
Когда сказать нет. Арсений КравченкоТранслируем.бел
 
SMM учебник. Как продвигать банк в социальных сетях. Наглядное пособие
SMM учебник. Как продвигать банк в социальных сетях. Наглядное пособиеSMM учебник. Как продвигать банк в социальных сетях. Наглядное пособие
SMM учебник. Как продвигать банк в социальных сетях. Наглядное пособиеТранслируем.бел
 
методы монетизации интернет проектов
методы монетизации интернет проектовметоды монетизации интернет проектов
методы монетизации интернет проектовТранслируем.бел
 

Mais de Транслируем.бел (20)

Медицинские трансляции
Медицинские трансляцииМедицинские трансляции
Медицинские трансляции
 
Vinteo
VinteoVinteo
Vinteo
 
Руководство по видео, трансляциям и премьерам (Youtube 2020)
Руководство по видео, трансляциям и премьерам (Youtube 2020)Руководство по видео, трансляциям и премьерам (Youtube 2020)
Руководство по видео, трансляциям и премьерам (Youtube 2020)
 
Корпоративный новый год онлайн
Корпоративный новый год онлайнКорпоративный новый год онлайн
Корпоративный новый год онлайн
 
Unofficial guide to vmix by streamgeeks
Unofficial guide to vmix by streamgeeksUnofficial guide to vmix by streamgeeks
Unofficial guide to vmix by streamgeeks
 
Руководство для малого и среднего бизнеса по использованию цифровых решений
Руководство для малого и среднего бизнеса по использованию цифровых решенийРуководство для малого и среднего бизнеса по использованию цифровых решений
Руководство для малого и среднего бизнеса по использованию цифровых решений
 
Sennheiser ew100 g2
Sennheiser ew100 g2Sennheiser ew100 g2
Sennheiser ew100 g2
 
Sony mcs 8m
Sony mcs 8mSony mcs 8m
Sony mcs 8m
 
Сравнение поколений Y и Z
Сравнение поколений Y и ZСравнение поколений Y и Z
Сравнение поколений Y и Z
 
Онлайн-трансляции в соцсетях
Онлайн-трансляции в соцсетяхОнлайн-трансляции в соцсетях
Онлайн-трансляции в соцсетях
 
Как организовать трансляцию в Facebook
Как организовать трансляцию в FacebookКак организовать трансляцию в Facebook
Как организовать трансляцию в Facebook
 
The ultimate guide to facebook live for your event
The ultimate guide to facebook live for your eventThe ultimate guide to facebook live for your event
The ultimate guide to facebook live for your event
 
Guide to facebook live
Guide to facebook liveGuide to facebook live
Guide to facebook live
 
Comdi player
Comdi playerComdi player
Comdi player
 
Что сделать, чтобы сто раз все не переделывать
Что сделать, чтобы сто раз все не переделыватьЧто сделать, чтобы сто раз все не переделывать
Что сделать, чтобы сто раз все не переделывать
 
Когда сказать нет. Арсений Кравченко
Когда сказать нет. Арсений КравченкоКогда сказать нет. Арсений Кравченко
Когда сказать нет. Арсений Кравченко
 
Marketing Essentials for Startup Teams
Marketing Essentials for Startup TeamsMarketing Essentials for Startup Teams
Marketing Essentials for Startup Teams
 
SMM учебник. Как продвигать банк в социальных сетях. Наглядное пособие
SMM учебник. Как продвигать банк в социальных сетях. Наглядное пособиеSMM учебник. Как продвигать банк в социальных сетях. Наглядное пособие
SMM учебник. Как продвигать банк в социальных сетях. Наглядное пособие
 
методы монетизации интернет проектов
методы монетизации интернет проектовметоды монетизации интернет проектов
методы монетизации интернет проектов
 
Belarus internet users discovery
Belarus internet users discoveryBelarus internet users discovery
Belarus internet users discovery
 

Último

MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 

Último (20)

MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 

Advanced Mobile Optimizations

  • 1. Advanced Mobile Optimizations How to go to 60 fps after you have removed all Sleep calls ;-)
  • 2. Disclaimer The views expressed here are my personal views and do not necessarily reflect the thoughts, opinions, intentions, plans or strategies of Unity
  • 3. Optimization Mindset you can't just make your game faster there is no magic bullet very specific stuff not the same as scripting charachter
  • 4. Optimization Mindset not in specific order know think measure
  • 5. Optimization Mindset You can't avoid any of that no, really
  • 6. Optimization Mindset know + think = shoot in the dark you just write code hoping for the best know + measure = shoot in the dark you are missing "understand" part think + measure = shoot in the dark you solve abstract problem, not real
  • 7. Optimization Mindset: know + think hardware is more complex then you think highly parallel deep pipelining when you write asm - high-level already
  • 8. Optimization Mindset: know + measure knowledge is static knowledge comes from the past knowledge is general
  • 9. Optimization Mindset: know + measure qsort vs bubble sort sure, qsort is faster but you are missing the point maybe radix? maybe no need to sort? maybe insertion? parallel sorting network?
  • 10. Optimization Mindset: think + measure solving abstract problem example: GPU optimizing for RIVA TNT and GTX is different
  • 11. Optimization Mindset well, if you are missing two from the three no comments
  • 12. Know your hardware your data knowing data is interleaved with think we will talk more of it in "think"
  • 13. Know your hardware GPU CPU whatever e.g. disk load speed
  • 14. Know your hardware: GPU Pipeline meaning - slow step = slow everything you are as slow as your bottleneck Know your pipeline Won't go into full pipeline spec Resources section Just common/biggest problems
  • 15. Know your hardware: GPU Geometry pre/post tnl cache should use indexed geometry or not cache hit rate strips vs tri list memory throughput vertex size fetch cost (memory) pack attributes or not
  • 16. Know your hardware: GPU Textures Texture Cache swizzle compression mip-maps Biggest memory hog
  • 17. Know your hardware: GPU Shaders VertexProgram vs FragmentShader balancing attributes Unified Shaders load balancing Precision gles: highp/mediump/lowp CG: float/half/fixed (iirc)
  • 18. Know your hardware: GPU Rasterization Fillrate (memory speed) alpha 2x2 samples (or more) why GometryLOD matters
  • 19. Know your hardware: CPU Mobile = in-order RISC for stupid code far worse than CISC 2 main issues: Memory speed Computation speed
  • 20. Know your hardware: CPU Memory This is single most important factor memory access far slower then computation Latency vs Throughput Caches fast memory your best friend L1/L2/whatever LHS
  • 21. Know your hardware: CPU Computations SIMD better memory usage better arithmetic usage (4 vals instead of 1)
  • 22. Know your target hardware There were general rules But you are running on that particular piece of sh... hardware
  • 23. Know your target hardware: PowerVR TBDR perfect hidden surface removal Alpha-Test/discard shader precision unified shaders Tegra / ATI-AMD / Adreno more common
  • 24. Know your target hardware: ARM VFP = FPU on steroids (not real SIMD) scalar instructions at same speed as vectorized NEON = SIMD more registers awesome load/store instructions not as cool as Altivec but cool enough for mobiles
  • 25. Know your target hardware: ARM Conditional execution of most instructions Fold shifts and rotates into the "data processing" instructions load structure from array by index Thumb + float = disaster switch back and forth between Thumb mode and regular 32-bit mode
  • 26. Know your hardware: Resources RTR lots of whitepapers: powerVR (imgtech) tegra (nvidia) adreno (qualcomm) AMD/ATI - basically the same as X360, but much smaller tiles ARM dev center
  • 27. Think Think about your data Think about your algorithms Think about your constraints Think about your hardware
  • 28. Think Basics CPU vs GPU e.g. draw calls pure CPU cost CPU: memory vs arithmetic memory slower GPU: vprog vs fshader memory vs arithmetic
  • 29. Think Memory fragmentation data organization AOS vs SOA hot/cold split data structures linear vs random array vs list map vs hashtable allocators
  • 30. Think Constraints GPU: will you see the difference? really? on mobile screen? on that one small thingy in the corner? CPU: will you need that? e.g. physics in casual game? Memory: will you need that? will you need more then XXX actors?
  • 31. Measure you didn't optimize anything if you didn't measure difference you can't optimize if you don't know what needs to be optimized if you can't measure what takes time
  • 32. Measure Tools there are lots of tools instruments (ios) perfhud (tegra) adreno profiler (qualcomm) some more probably Poor-man profiler timers
  • 33. Unity use case:random bits Mobile shaders specialized of usual built-ins Skinning full NEON/VFP impl usually 10-15% of c-code time and we are not done optimizing it ;-) Rej's baking material to texture and coming soon BRDF baking to texture
  • 34. Unity use case:random bits Remote Profiler run on target hw, data is transferred over wifi collect in Editor and show pretty graphs ;-) Sort alpha-test *after* opaque check *lots* of extensions LODs - almost done Vertex Cache optimization - after LODs ;-)
  • 35. Closing Words Know hardware Know data Think data Think constraints Measure always You better know earlier You should be always optimizing