SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Ähnlich wie 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
 

Ähnlich wie 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...
 

Mehr von Транслируем.бел

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

Mehr von Транслируем.бел (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
 

Kürzlich hochgeladen

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 

Kürzlich hochgeladen (20)

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

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