SlideShare uma empresa Scribd logo
1 de 79
Optimizing Mobile Applications
Introduction
Us
Mark Ian
About This Talk
• Getting Good Data
• General Best Practices
• Common Problems & Solutions
• Memory Usage
• CPU Performance
Profiling
Use The Best Tools
• iOS: Instruments
• Android: VTune, Snapdragon Profiler
• Unity Editor
• Timeline
• 5.3: Memory Profiler
Instruments!
• Free, included with XCode
• Works perfectly with Unity IL2CPP builds
• Best tool for mobile CPU profiling
• Best tool for startup time profiling
Instruments! (2)
• Instructions on how to run it:
• http://blogs.unity3d.com/2016/02/01/profiling-with-
instruments/
Instruments CPU Profiler: Startup Time
Instruments CPU Profiler: Runtime
Instruments: Reading the PlayerLoop
• BaseBehaviourManager::CommonUpdate
• Update, FixedUpdate and LateUpdate callbacks
• PhysicsManager::FixedUpdate
• PhysX simulation, OnCollision* and OnTrigger* callbacks
• Physics2DManager::FixedUpdate if using 2D physics
• DelayedCallManager::Update
• Resumed coroutines
Instruments: Reading the PlayerLoop (2)
• PlayerRender
• Draw calls, batching, OnWillRender & image effect callbacks
• UI::CanvasManager::WillRenderCanvases
• UI canvas rebatching, text mesh generation, etc.
• EnlightenRuntimeManager::Update
• Enlighten, precomputed realtime GI, reflection probes
Instruments: Examining a Callback
Instruments: Examining a Coroutine
Instruments: Coroutines (2)
• Coroutine execution is split between two places:
• The method where the coroutine was started.
• i.e. where StartCoroutine() was called
• DelayedCallManager
• StartCoroutine runs all code until the first yield
• DelayedCalledManager runs the rest
Instruments: Summarizing Distributed Costs
• Enter method name into “Search” box
• Suggested searches:
• “::Box”, “Box(“ and “_Box”
• “String_”
Instruments: Identifying Asset Loads
5.3 Memory Profiler
5.3 Memory Profiler
• Download code from Bitbucket
• http://bitbucket.org/Unity-Technologies/MemoryProfiler/
• Drop into an Editor folder inside Assets
• In Unity Editor: Window > MemoryProfilerWindow
• Connect Unity Profiler via Profiler Window
• Click “Take Snapshot”
5.3 Memory Profiler: Duplicated Textures
Examine
these
5.3 Memory Profiler: Duplicated Textures
Same Texture, Different Instances
Same
Different
5.3 Memory Profiler
Assets
Asset Auditing: Preventing Mistakes
• Developers are people (arguably)
• People make mistakes
• Mistakes cost dev time
• Write tools to prevent common, costly errors
Asset Auditing: Common Errors
• Insane texture sizes
• Asset compression
• Improper Avatar/Rig settings
• Different rules for different parts of project
Asset Auditing: HOWTO
public class AssetAuditExample : AssetPostprocessor {
public void OnPreprocessTexture() {
// …
}
public void OnPreprocessModel() {
// …
}
}
Asset Auditing: HOWTO (2)
• AssetPostprocessor classes receive callbacks on import
• Implement OnPreprocess* methods
• Apply your project’s rules to assetImporter instance
Asset Auditing: HOWTO (3)
public class ReadOnlyModelPostprocessor : AssetPostprocessor {
public void OnPreprocessModel() {
ModelImporter modelImporter = (ModelImporter)assetImporter;
if(modelImporter.isReadable) {
modelImporter.isReadable = false;
modelImporter.SaveAndReimport();
}
}
}
Common Rules: Textures
• Make sure Read/Write is disabled
• Disable mipmaps if possible
• Make sure textures are Compressed
• Ensure sizes aren’t too large
• 2048x2048 or 1024x1024 for UI atlases
• 512x512 or smaller for model textures
Common Rules: Models
• Make sure Read/Write is disabled
• Disable rig on non-character models
• Copy avatars for characters with shared rigs
• Enable mesh compression
Common Rules: Audio
• MP3 compression on iOS
• Vorbis compression on Android
• “Force Mono” for mobile games
• Set bitrate as low as possible
Memory in Unity
Managed Memory: How It Works
Texture #1Texture #2Audio ClipMesh
int[] Arraystringstringstring
Heap contains objects allocated for Assets and Scripts
Managed Memory: How It Works
Texture #1Texture #2Audio ClipMesh
int[] Arraystringstringstring
int[] someNumbers = new int[2048];
More memory is allocated when requested by code.
int[] Array
Managed Memory: How It Works
Texture #1Texture #2Audio ClipMesh
int[] Arraystringstringstring
GC.Collect();
Garbage collector runs periodically, looks for unused
objects.
Unused objects are deleted.
int[] Array
Managed Memory: How It Works
Texture #1Texture #2Audio ClipMesh
int[] Arraystring
Holes are not filled. This is Memory Fragmentation.
int[] Array
Managed Memory: How It Works
Texture #1Texture #2Audio ClipMesh
int[] Arraystring
When there isn’t enough space for new objects…
int[] Array
int[] Array
TOO SMALL
Managed Memory: How It Works
Texture #1Texture #2Audio ClipMesh
int[] Arraystring
The heap expands.
int[] Array
int[] Array
Managed Memory: Problems
• In Unity, the heap only expands. It never shrinks.
• iOS & Android still care about reserved pages.
• Detail: Unused blocks of the heap remain reserved, but
are paged out of the working set.
Managed Memory: Problems (2)
• Temporary memory allocations are really bad.
• 1 kilobyte of allocation per frame, 60 FPS
• = 60 kilobytes per second of allocation
• If GC runs once per minute (BAD for framerate)…
• 3600 kilobytes of memory needed!
Tracking Managed Memory Allocations
Use Unity Profiler.
Sort by “GC Alloc” column.
When user can interact with app, stay as
close to zero as possible.
(During loading, allocations aren’t as bad.)
Memory Conservation
• Reuse Collections (Lists, HashSets, etc.)
• Avoid string concatenation
• Reuse StringBuilders to compose strings
• Avoid closures & anonymous methods
Memory Conservation: Boxing
• Happens when passing a value type as a reference
type.
• Value is temporarily allocated on the heap.
• Example:
int x = 1;
object y = new object();
y.Equals(x); // Boxes “x” onto the heap
Memory Conservation: Boxing (2)
• Also happens when using enums as Dictionary keys
• Example:
enum MyEnum { a, b, c };
var myDictionary = new Dictionary<MyEnum, object>();
myDictionary.Add(MyEnum.a, new object()); // Boxes value “MyEnum.a”
• Workaround: Implement IEqualityComparer class
Memory Conservation: Foreach
• Allocates a Enumerator when loop begins
• Specific to Unity’s version of Mono
• Just don’t use it.
Memory Conservation: Unity APIs
• If a Unity API returns an array, it allocates a new copy.
• Every time it is accessed.
• Even if the values do not change.
Memory Conservation: Unity APIs (2)
• This code allocates many Touch[] arrays.
for ( int i = 0; i < Input.touches.Length; i++ )
{
Touch touch = Input.touches[i];
// …
}
Memory Conservation: Unity APIs (3)
• This code allocates only one copy of the Touch[] array.
Touch[] touches = Input.touches;
for ( int i = 0; i < touches.Length; i++ )
{
Touch touch = touches[i];
// …
}
CPU Performance Tips: Loading
XML, JSON & other text formats
• Parsing text is very slow.
• Avoid parsers built on Reflection — extremely slow.
• In 5.3: Use Unity’s JsonUtility class!
• Three strategies to speed up data parsing.
XML/JSON: Reduce Workload
• Strategy 1: Don’t parse text.
• Bake text data to binary
• Use ScriptableObject
• Useful for data that does not change often.
• e.g. Game design parameters
XML/JSON: Reduce Workload (2)
• Strategy 2: Do less work.
• Split data into smaller chunks.
• Parse only the parts that are needed.
• Cache parsing results for later reuse.
XML/JSON: Reduce Workload (3)
• Strategy 3: Threads.
• Pure C# types only.
• No Unity Assets (ScriptableObjects, Textures, etc.)
• Be VERY careful.
Large Prefabs
• All GameObjects & Components in a prefab are
serialized into the prefab’s data file.
• Includes all settings on all Components.
• 2 identical GameObjects in a prefab = 2 copies of data
Large Prefabs (2)
• For very large prefabs, split into smaller parts
• Use Awake callbacks to instantiate duplicated parts
The Resources Folder
• An index of Resources is loaded at startup.
• Cannot be avoided or deferred.
• Solution: Move assets from Resources to Asset
Bundles.
CPU Performance Tips: Runtime
Easy: Material/Animator/Shader Properties
• Never address Material, Shader, or Animator properties
by name.
• Internally, hashes the property name into an integer.
• Don’t do this:
material.SetColor(“_Color”, Color.white);
animator.SetTrigger(“attack”);
Cached Material/Animator/Shader
Properties
• Do hashing at startup, cache results and reuse them.
static readonly int material_Color = Shader.PropertyToID(“_Color”);
static readonly int anim_Attack = Animator.StringToHash(“attack”);
material.SetColor(material_Color, Color.white);
animator.SetTrigger(anim_Attack);
Boxing & String Manipulation
• These are so expensive we had to mention them twice.
• Slow: RegExps, String.StartsWith, String.EndsWith
• Instruments:
• Search for “::Box” and “_Box”
• Search for “String_”
Instruments: Identifying Boxing
Unity UI
Canvases, Draw Calls and Batching
• Canvases “rebuild” their batches to reduce draw calls
• Rebuilds are very expensive.
• A canvas rebuilds if any Drawable component changes.
• Any visual change will force a canvas to rebuild.
• Drawable = anything visible on a canvas.
Canvases, Draw Calls and Batching
• Cost of a rebuild based on number of elements.
• Includes children.
• Frequent changes + lots of UI = lots of CPU usage!
Reducing Batching Cost
• Reduce number of Drawables.
• Merge sprites, merge text objects
• Split up Canvases
• Balance cost of draw calls and cost of batching.
Splitting Canvases
• Can nest a canvas within another canvas
• Nested canvases isolate their children from rebuilds.
• Guideline: Move elements that change every frame onto
separate canvases from static elements.
Splitting Canvases: Example
Splitting Canvases: Example
Images
Splitting Canvases: Example
Change Every Frame Never Change
Splitting Canvases: Example
Dynamic Canvas Background Canvas
Trampolines
Remember…
• Profile before optimizing.
• Apply these techniques only when needed.
How Unity Invokes Callbacks
• Internally, C++ Linked List of Components with callbacks
• Update, LateUpdate, etc.
• Iterate over the Linked List and invoke each callback.
• Small overhead when invoking scripts
How Unity Invokes Callbacks
• If number of callbacks becomes very large, overhead
can become significant.
• Thousands of callbacks: 10-20% of Update CPU time
Replacing Callbacks
• Remove Update, LateUpdate, etc.
• Make a GameObject with a MonoBehaviour
• Implement Update, LateUpdate, and other callbacks on this
object
• All other code: Subscribe to needed callbacks
Replacing Callbacks: UpdateManager
object
public class UpdateManager : MonoBehaviour {
public static UpdateManager Instance { get; set; }
void Awake() { Instance = this; }
public UnityEvent OnUpdate = new UnityEvent();
void Update() {
OnUpdate.Invoke();
}
}
Replacing Callbacks: Advantages
• Eliminates native-to-managed trampoline overhead.
• Objects can intelligently unsubscribe.
• Don’t need to return out of Update callbacks!
• Works well with pooled objects.
0507 057 01 98 * Adana Cukurova Klima Servisleri

Mais conteúdo relacionado

Mais procurados

What is jubatus? How it works for you?
What is jubatus? How it works for you?What is jubatus? How it works for you?
What is jubatus? How it works for you?Kumazaki Hiroki
 
Optimizing Large Scenes in Unity
Optimizing Large Scenes in UnityOptimizing Large Scenes in Unity
Optimizing Large Scenes in UnityNoam Gat
 
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)   A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig) David Salz
 
Practical Guide for Optimizing Unity on Mobiles
Practical Guide for Optimizing Unity on MobilesPractical Guide for Optimizing Unity on Mobiles
Practical Guide for Optimizing Unity on MobilesValentin Simonov
 
Intro to Python (High School) Unit #2
Intro to Python (High School) Unit #2Intro to Python (High School) Unit #2
Intro to Python (High School) Unit #2Jay Coskey
 
Data oriented design and c++
Data oriented design and c++Data oriented design and c++
Data oriented design and c++Mike Acton
 
Deterministic Simulation - What modern online games can learn from the Game B...
Deterministic Simulation - What modern online games can learn from the Game B...Deterministic Simulation - What modern online games can learn from the Game B...
Deterministic Simulation - What modern online games can learn from the Game B...David Salz
 
[UniteKorea2013] The Unity Rendering Pipeline
[UniteKorea2013] The Unity Rendering Pipeline[UniteKorea2013] The Unity Rendering Pipeline
[UniteKorea2013] The Unity Rendering PipelineWilliam Hugo Yang
 
Multithreading
MultithreadingMultithreading
MultithreadingF K
 
Pitfalls of object_oriented_programming_gcap_09
Pitfalls of object_oriented_programming_gcap_09Pitfalls of object_oriented_programming_gcap_09
Pitfalls of object_oriented_programming_gcap_09Royce Lu
 
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtug
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtugVk.amberfog.com gtug part1_introduction2_javaandroid_gtug
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtugketan_patel25
 
HES2011 - Aaron Portnoy and Logan Brown - Black Box Auditing Adobe Shockwave
HES2011 - Aaron Portnoy and Logan Brown - Black Box Auditing Adobe ShockwaveHES2011 - Aaron Portnoy and Logan Brown - Black Box Auditing Adobe Shockwave
HES2011 - Aaron Portnoy and Logan Brown - Black Box Auditing Adobe ShockwaveHackito Ergo Sum
 
Unite2013-gavilan-pdf
Unite2013-gavilan-pdfUnite2013-gavilan-pdf
Unite2013-gavilan-pdfDavid Gavilan
 
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法Unite2017Tokyo
 

Mais procurados (20)

What is jubatus? How it works for you?
What is jubatus? How it works for you?What is jubatus? How it works for you?
What is jubatus? How it works for you?
 
Optimizing Large Scenes in Unity
Optimizing Large Scenes in UnityOptimizing Large Scenes in Unity
Optimizing Large Scenes in Unity
 
DIY Java Profiling
DIY Java ProfilingDIY Java Profiling
DIY Java Profiling
 
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)   A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
 
Practical Guide for Optimizing Unity on Mobiles
Practical Guide for Optimizing Unity on MobilesPractical Guide for Optimizing Unity on Mobiles
Practical Guide for Optimizing Unity on Mobiles
 
Intro to Python (High School) Unit #2
Intro to Python (High School) Unit #2Intro to Python (High School) Unit #2
Intro to Python (High School) Unit #2
 
Qtp - Introduction to synchronization
Qtp -  Introduction to synchronizationQtp -  Introduction to synchronization
Qtp - Introduction to synchronization
 
Data oriented design and c++
Data oriented design and c++Data oriented design and c++
Data oriented design and c++
 
Deterministic Simulation - What modern online games can learn from the Game B...
Deterministic Simulation - What modern online games can learn from the Game B...Deterministic Simulation - What modern online games can learn from the Game B...
Deterministic Simulation - What modern online games can learn from the Game B...
 
multithreading
multithreadingmultithreading
multithreading
 
J2SE 5
J2SE 5J2SE 5
J2SE 5
 
Java
JavaJava
Java
 
[UniteKorea2013] The Unity Rendering Pipeline
[UniteKorea2013] The Unity Rendering Pipeline[UniteKorea2013] The Unity Rendering Pipeline
[UniteKorea2013] The Unity Rendering Pipeline
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Pitfalls of object_oriented_programming_gcap_09
Pitfalls of object_oriented_programming_gcap_09Pitfalls of object_oriented_programming_gcap_09
Pitfalls of object_oriented_programming_gcap_09
 
Java
JavaJava
Java
 
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtug
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtugVk.amberfog.com gtug part1_introduction2_javaandroid_gtug
Vk.amberfog.com gtug part1_introduction2_javaandroid_gtug
 
HES2011 - Aaron Portnoy and Logan Brown - Black Box Auditing Adobe Shockwave
HES2011 - Aaron Portnoy and Logan Brown - Black Box Auditing Adobe ShockwaveHES2011 - Aaron Portnoy and Logan Brown - Black Box Auditing Adobe Shockwave
HES2011 - Aaron Portnoy and Logan Brown - Black Box Auditing Adobe Shockwave
 
Unite2013-gavilan-pdf
Unite2013-gavilan-pdfUnite2013-gavilan-pdf
Unite2013-gavilan-pdf
 
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
 

Destaque (14)

Blog about editing
Blog about editingBlog about editing
Blog about editing
 
Assignment 17 Pitch
Assignment 17 PitchAssignment 17 Pitch
Assignment 17 Pitch
 
CHEF T CUISINE
CHEF T CUISINECHEF T CUISINE
CHEF T CUISINE
 
Nia
NiaNia
Nia
 
Music videos Assignement 1
Music videos Assignement 1Music videos Assignement 1
Music videos Assignement 1
 
Tyler james final ppp slide show
Tyler james final ppp slide showTyler james final ppp slide show
Tyler james final ppp slide show
 
Family
FamilyFamily
Family
 
Characters for the house guest
Characters for the house guestCharacters for the house guest
Characters for the house guest
 
Tatiana (1)
Tatiana (1)Tatiana (1)
Tatiana (1)
 
Презентация Кубанского юридического колледжа
Презентация Кубанского юридического колледжаПрезентация Кубанского юридического колледжа
Презентация Кубанского юридического колледжа
 
Direct2voice Opportunity Launch
Direct2voice Opportunity LaunchDirect2voice Opportunity Launch
Direct2voice Opportunity Launch
 
Business class - Chapter 1
Business class - Chapter 1Business class - Chapter 1
Business class - Chapter 1
 
SIP
SIPSIP
SIP
 
Tc and cmc
Tc and cmcTc and cmc
Tc and cmc
 

Semelhante a 0507 057 01 98 * Adana Cukurova Klima Servisleri

【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法Unity Technologies Japan K.K.
 
Optimization in Unity: simple tips for developing with "no surprises" / Anton...
Optimization in Unity: simple tips for developing with "no surprises" / Anton...Optimization in Unity: simple tips for developing with "no surprises" / Anton...
Optimization in Unity: simple tips for developing with "no surprises" / Anton...DevGAMM Conference
 
The Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidThe Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidStanojko Markovik
 
Preventing Complexity in Game Programming
Preventing Complexity in Game ProgrammingPreventing Complexity in Game Programming
Preventing Complexity in Game ProgrammingYaser Zhian
 
Profiling tools and Android Performance patterns
Profiling tools and Android Performance patternsProfiling tools and Android Performance patterns
Profiling tools and Android Performance patternsicemobile
 
High Performance With Java
High Performance With JavaHigh Performance With Java
High Performance With Javamalduarte
 
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...Lviv Startup Club
 
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
GDC 2010 - A Dynamic Component Architecture for High Performance GameplayGDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
GDC 2010 - A Dynamic Component Architecture for High Performance GameplayTerrance Cohen
 
What's new in Xamarin.iOS, by Miguel de Icaza
What's new in Xamarin.iOS, by Miguel de IcazaWhat's new in Xamarin.iOS, by Miguel de Icaza
What's new in Xamarin.iOS, by Miguel de IcazaXamarin
 
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...Terrance Cohen
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disquszeeg
 
Vulnerability, exploit to metasploit
Vulnerability, exploit to metasploitVulnerability, exploit to metasploit
Vulnerability, exploit to metasploitTiago Henriques
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Andrei KUCHARAVY
 
One-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic AnalysisOne-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic AnalysisTakahiro Haruyama
 
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろうUnity Technologies Japan K.K.
 
Treasure Data Summer Internship 2016
Treasure Data Summer Internship 2016Treasure Data Summer Internship 2016
Treasure Data Summer Internship 2016Yuta Iwama
 
Cansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_Compromised
Cansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_CompromisedCansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_Compromised
Cansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_CompromisedLiang Chen
 
Никита Корчагин - Programming Apple iOS with Objective-C
Никита Корчагин - Programming Apple iOS with Objective-CНикита Корчагин - Programming Apple iOS with Objective-C
Никита Корчагин - Programming Apple iOS with Objective-CDataArt
 
MFF UK - Introduction to iOS
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOSPetr Dvorak
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchMats Bryntse
 

Semelhante a 0507 057 01 98 * Adana Cukurova Klima Servisleri (20)

【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
 
Optimization in Unity: simple tips for developing with "no surprises" / Anton...
Optimization in Unity: simple tips for developing with "no surprises" / Anton...Optimization in Unity: simple tips for developing with "no surprises" / Anton...
Optimization in Unity: simple tips for developing with "no surprises" / Anton...
 
The Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidThe Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with android
 
Preventing Complexity in Game Programming
Preventing Complexity in Game ProgrammingPreventing Complexity in Game Programming
Preventing Complexity in Game Programming
 
Profiling tools and Android Performance patterns
Profiling tools and Android Performance patternsProfiling tools and Android Performance patterns
Profiling tools and Android Performance patterns
 
High Performance With Java
High Performance With JavaHigh Performance With Java
High Performance With Java
 
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
Шлигін Олександр “Розробка ігор в Unity загальні помилки” GameDev Conference ...
 
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
GDC 2010 - A Dynamic Component Architecture for High Performance GameplayGDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
 
What's new in Xamarin.iOS, by Miguel de Icaza
What's new in Xamarin.iOS, by Miguel de IcazaWhat's new in Xamarin.iOS, by Miguel de Icaza
What's new in Xamarin.iOS, by Miguel de Icaza
 
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay - M...
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disqus
 
Vulnerability, exploit to metasploit
Vulnerability, exploit to metasploitVulnerability, exploit to metasploit
Vulnerability, exploit to metasploit
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1
 
One-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic AnalysisOne-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic Analysis
 
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう
 
Treasure Data Summer Internship 2016
Treasure Data Summer Internship 2016Treasure Data Summer Internship 2016
Treasure Data Summer Internship 2016
 
Cansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_Compromised
Cansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_CompromisedCansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_Compromised
Cansecwest_16_Dont_Trust_Your_Eye_Apple_Graphics_Is_Compromised
 
Никита Корчагин - Programming Apple iOS with Objective-C
Никита Корчагин - Programming Apple iOS with Objective-CНикита Корчагин - Programming Apple iOS with Objective-C
Никита Корчагин - Programming Apple iOS with Objective-C
 
MFF UK - Introduction to iOS
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOS
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha Touch
 

Mais de Adana Klima Servisi Bakım Montaj Taşıma Temizlik Tamir Arıza Teknik Servisleri

Mais de Adana Klima Servisi Bakım Montaj Taşıma Temizlik Tamir Arıza Teknik Servisleri (20)

Adana'da 15 yaşındaki kız 14’üncü kattan düşerek öldü
Adana'da 15 yaşındaki kız 14’üncü kattan düşerek öldüAdana'da 15 yaşındaki kız 14’üncü kattan düşerek öldü
Adana'da 15 yaşındaki kız 14’üncü kattan düşerek öldü
 
Kutup buzulları eriyince ortaya çıktı. Bilim insanları aynı anda dehşete düştü
Kutup buzulları eriyince ortaya çıktı. Bilim insanları aynı anda dehşete düştüKutup buzulları eriyince ortaya çıktı. Bilim insanları aynı anda dehşete düştü
Kutup buzulları eriyince ortaya çıktı. Bilim insanları aynı anda dehşete düştü
 
İran Cumhurbaşkanı Ruhani'den ABD seçimlerine dair flaş açıklama
İran Cumhurbaşkanı Ruhani'den ABD seçimlerine dair flaş açıklamaİran Cumhurbaşkanı Ruhani'den ABD seçimlerine dair flaş açıklama
İran Cumhurbaşkanı Ruhani'den ABD seçimlerine dair flaş açıklama
 
Almanya'da günlük en yüksek Kovid-19 vaka sayısına ulaşıldı
Almanya'da günlük en yüksek Kovid-19 vaka sayısına ulaşıldıAlmanya'da günlük en yüksek Kovid-19 vaka sayısına ulaşıldı
Almanya'da günlük en yüksek Kovid-19 vaka sayısına ulaşıldı
 
Çin'den Dev Adım: Dünyanın İlk 6G Deneme Uydusu Uzaya Gönderildi
Çin'den Dev Adım: Dünyanın İlk 6G Deneme Uydusu Uzaya GönderildiÇin'den Dev Adım: Dünyanın İlk 6G Deneme Uydusu Uzaya Gönderildi
Çin'den Dev Adım: Dünyanın İlk 6G Deneme Uydusu Uzaya Gönderildi
 
Son dakika… ABD’nin yeni başkanı Joe Biden oldu
Son dakika… ABD’nin yeni başkanı Joe Biden olduSon dakika… ABD’nin yeni başkanı Joe Biden oldu
Son dakika… ABD’nin yeni başkanı Joe Biden oldu
 
Rüzgarda uçuşan binlerce lirayı böyle topladılar
Rüzgarda uçuşan binlerce lirayı böyle topladılarRüzgarda uçuşan binlerce lirayı böyle topladılar
Rüzgarda uçuşan binlerce lirayı böyle topladılar
 
Sağlık çalışanlarının bulunduğu otomobil Ihlara Vadisi'ne uçtu
Sağlık çalışanlarının bulunduğu otomobil Ihlara Vadisi'ne uçtuSağlık çalışanlarının bulunduğu otomobil Ihlara Vadisi'ne uçtu
Sağlık çalışanlarının bulunduğu otomobil Ihlara Vadisi'ne uçtu
 
Belgeseli yayınlandıktan 3 hafta sonra koronavirüsten yaşamını yitirdi
Belgeseli yayınlandıktan 3 hafta sonra koronavirüsten yaşamını yitirdiBelgeseli yayınlandıktan 3 hafta sonra koronavirüsten yaşamını yitirdi
Belgeseli yayınlandıktan 3 hafta sonra koronavirüsten yaşamını yitirdi
 
Corona listesini yayınlayan filyasyon ekibindeki görevliye soruşturma
Corona listesini yayınlayan filyasyon ekibindeki görevliye soruşturmaCorona listesini yayınlayan filyasyon ekibindeki görevliye soruşturma
Corona listesini yayınlayan filyasyon ekibindeki görevliye soruşturma
 
Erdoğan: Bahçeli ile birlikte Kıbrıs’ta piknik yapacağız
Erdoğan: Bahçeli ile birlikte Kıbrıs’ta piknik yapacağızErdoğan: Bahçeli ile birlikte Kıbrıs’ta piknik yapacağız
Erdoğan: Bahçeli ile birlikte Kıbrıs’ta piknik yapacağız
 
Sigara içme yasağı olan iller! Hangi illerde sigara içme yasağı var?
Sigara içme yasağı olan iller! Hangi illerde sigara içme yasağı var?Sigara içme yasağı olan iller! Hangi illerde sigara içme yasağı var?
Sigara içme yasağı olan iller! Hangi illerde sigara içme yasağı var?
 
Ekrem İmamoğlu’ndan Tunç Soyer’e geçmiş olsun ziyareti
 Ekrem İmamoğlu’ndan Tunç Soyer’e geçmiş olsun ziyareti Ekrem İmamoğlu’ndan Tunç Soyer’e geçmiş olsun ziyareti
Ekrem İmamoğlu’ndan Tunç Soyer’e geçmiş olsun ziyareti
 
Merkez Bankasındaki görev değişikliği dünyanın gündeminde
Merkez Bankasındaki görev değişikliği dünyanın gündemindeMerkez Bankasındaki görev değişikliği dünyanın gündeminde
Merkez Bankasındaki görev değişikliği dünyanın gündeminde
 
Adana'da Ekim ayında meydana gelen trafik kazalarında 15 kişi öldü
Adana'da Ekim ayında meydana gelen trafik kazalarında 15 kişi öldüAdana'da Ekim ayında meydana gelen trafik kazalarında 15 kişi öldü
Adana'da Ekim ayında meydana gelen trafik kazalarında 15 kişi öldü
 
Adana Jeofizik Mühendisleri Odası’ndan Korkutan Açıklama
Adana Jeofizik Mühendisleri Odası’ndan Korkutan AçıklamaAdana Jeofizik Mühendisleri Odası’ndan Korkutan Açıklama
Adana Jeofizik Mühendisleri Odası’ndan Korkutan Açıklama
 
Adana Klima Servisi Bakım Montaj Taşıma Temizlik Tamir Arıza Teknik Servisler...
Adana Klima Servisi Bakım Montaj Taşıma Temizlik Tamir Arıza Teknik Servisler...Adana Klima Servisi Bakım Montaj Taşıma Temizlik Tamir Arıza Teknik Servisler...
Adana Klima Servisi Bakım Montaj Taşıma Temizlik Tamir Arıza Teknik Servisler...
 
Adana'da FETÖ sanığı 7 eski polisin yargılanmasına devam edildi
Adana'da FETÖ sanığı 7 eski polisin yargılanmasına devam edildiAdana'da FETÖ sanığı 7 eski polisin yargılanmasına devam edildi
Adana'da FETÖ sanığı 7 eski polisin yargılanmasına devam edildi
 
Adana’da Ekim ayında bin 889 araç trafikten men edildi
Adana’da Ekim ayında bin 889 araç trafikten men edildiAdana’da Ekim ayında bin 889 araç trafikten men edildi
Adana’da Ekim ayında bin 889 araç trafikten men edildi
 
Adana’dan yardım tırları yola çıktı 8 tır yaşam malzemesi gönderildi
Adana’dan yardım tırları yola çıktı 8 tır yaşam malzemesi gönderildiAdana’dan yardım tırları yola çıktı 8 tır yaşam malzemesi gönderildi
Adana’dan yardım tırları yola çıktı 8 tır yaşam malzemesi gönderildi
 

Último

Botany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdfBotany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdfSumit Kumar yadav
 
Seismic Method Estimate velocity from seismic data.pptx
Seismic Method Estimate velocity from seismic  data.pptxSeismic Method Estimate velocity from seismic  data.pptx
Seismic Method Estimate velocity from seismic data.pptxAlMamun560346
 
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...chandars293
 
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Monika Rani
 
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bNightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bSérgio Sacani
 
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...Lokesh Kothari
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxgindu3009
 
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.Nitya salvi
 
GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)Areesha Ahmad
 
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verifiedConnaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...ssifa0344
 
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts ServiceJustdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Servicemonikaservice1
 
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICESAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICEayushi9330
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPirithiRaju
 
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls AgencyHire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls AgencySheetal Arora
 
module for grade 9 for distance learning
module for grade 9 for distance learningmodule for grade 9 for distance learning
module for grade 9 for distance learninglevieagacer
 
Forensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfForensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfrohankumarsinghrore1
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .Poonam Aher Patil
 

Último (20)

Botany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdfBotany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdf
 
Seismic Method Estimate velocity from seismic data.pptx
Seismic Method Estimate velocity from seismic  data.pptxSeismic Method Estimate velocity from seismic  data.pptx
Seismic Method Estimate velocity from seismic data.pptx
 
Site Acceptance Test .
Site Acceptance Test                    .Site Acceptance Test                    .
Site Acceptance Test .
 
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
 
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
 
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bNightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
 
Clean In Place(CIP).pptx .
Clean In Place(CIP).pptx                 .Clean In Place(CIP).pptx                 .
Clean In Place(CIP).pptx .
 
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptx
 
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
 
GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)
 
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verifiedConnaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
 
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
 
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts ServiceJustdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
 
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICESAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
 
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls AgencyHire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
 
module for grade 9 for distance learning
module for grade 9 for distance learningmodule for grade 9 for distance learning
module for grade 9 for distance learning
 
Forensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfForensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdf
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .
 

0507 057 01 98 * Adana Cukurova Klima Servisleri

  • 1.
  • 5. About This Talk • Getting Good Data • General Best Practices • Common Problems & Solutions • Memory Usage • CPU Performance
  • 7. Use The Best Tools • iOS: Instruments • Android: VTune, Snapdragon Profiler • Unity Editor • Timeline • 5.3: Memory Profiler
  • 8. Instruments! • Free, included with XCode • Works perfectly with Unity IL2CPP builds • Best tool for mobile CPU profiling • Best tool for startup time profiling
  • 9. Instruments! (2) • Instructions on how to run it: • http://blogs.unity3d.com/2016/02/01/profiling-with- instruments/
  • 12. Instruments: Reading the PlayerLoop • BaseBehaviourManager::CommonUpdate • Update, FixedUpdate and LateUpdate callbacks • PhysicsManager::FixedUpdate • PhysX simulation, OnCollision* and OnTrigger* callbacks • Physics2DManager::FixedUpdate if using 2D physics • DelayedCallManager::Update • Resumed coroutines
  • 13. Instruments: Reading the PlayerLoop (2) • PlayerRender • Draw calls, batching, OnWillRender & image effect callbacks • UI::CanvasManager::WillRenderCanvases • UI canvas rebatching, text mesh generation, etc. • EnlightenRuntimeManager::Update • Enlighten, precomputed realtime GI, reflection probes
  • 16. Instruments: Coroutines (2) • Coroutine execution is split between two places: • The method where the coroutine was started. • i.e. where StartCoroutine() was called • DelayedCallManager • StartCoroutine runs all code until the first yield • DelayedCalledManager runs the rest
  • 17. Instruments: Summarizing Distributed Costs • Enter method name into “Search” box • Suggested searches: • “::Box”, “Box(“ and “_Box” • “String_”
  • 20. 5.3 Memory Profiler • Download code from Bitbucket • http://bitbucket.org/Unity-Technologies/MemoryProfiler/ • Drop into an Editor folder inside Assets • In Unity Editor: Window > MemoryProfilerWindow • Connect Unity Profiler via Profiler Window • Click “Take Snapshot”
  • 21. 5.3 Memory Profiler: Duplicated Textures Examine these
  • 22. 5.3 Memory Profiler: Duplicated Textures Same Texture, Different Instances Same Different
  • 25. Asset Auditing: Preventing Mistakes • Developers are people (arguably) • People make mistakes • Mistakes cost dev time • Write tools to prevent common, costly errors
  • 26. Asset Auditing: Common Errors • Insane texture sizes • Asset compression • Improper Avatar/Rig settings • Different rules for different parts of project
  • 27. Asset Auditing: HOWTO public class AssetAuditExample : AssetPostprocessor { public void OnPreprocessTexture() { // … } public void OnPreprocessModel() { // … } }
  • 28. Asset Auditing: HOWTO (2) • AssetPostprocessor classes receive callbacks on import • Implement OnPreprocess* methods • Apply your project’s rules to assetImporter instance
  • 29. Asset Auditing: HOWTO (3) public class ReadOnlyModelPostprocessor : AssetPostprocessor { public void OnPreprocessModel() { ModelImporter modelImporter = (ModelImporter)assetImporter; if(modelImporter.isReadable) { modelImporter.isReadable = false; modelImporter.SaveAndReimport(); } } }
  • 30. Common Rules: Textures • Make sure Read/Write is disabled • Disable mipmaps if possible • Make sure textures are Compressed • Ensure sizes aren’t too large • 2048x2048 or 1024x1024 for UI atlases • 512x512 or smaller for model textures
  • 31. Common Rules: Models • Make sure Read/Write is disabled • Disable rig on non-character models • Copy avatars for characters with shared rigs • Enable mesh compression
  • 32. Common Rules: Audio • MP3 compression on iOS • Vorbis compression on Android • “Force Mono” for mobile games • Set bitrate as low as possible
  • 34. Managed Memory: How It Works Texture #1Texture #2Audio ClipMesh int[] Arraystringstringstring Heap contains objects allocated for Assets and Scripts
  • 35. Managed Memory: How It Works Texture #1Texture #2Audio ClipMesh int[] Arraystringstringstring int[] someNumbers = new int[2048]; More memory is allocated when requested by code. int[] Array
  • 36. Managed Memory: How It Works Texture #1Texture #2Audio ClipMesh int[] Arraystringstringstring GC.Collect(); Garbage collector runs periodically, looks for unused objects. Unused objects are deleted. int[] Array
  • 37. Managed Memory: How It Works Texture #1Texture #2Audio ClipMesh int[] Arraystring Holes are not filled. This is Memory Fragmentation. int[] Array
  • 38. Managed Memory: How It Works Texture #1Texture #2Audio ClipMesh int[] Arraystring When there isn’t enough space for new objects… int[] Array int[] Array TOO SMALL
  • 39. Managed Memory: How It Works Texture #1Texture #2Audio ClipMesh int[] Arraystring The heap expands. int[] Array int[] Array
  • 40. Managed Memory: Problems • In Unity, the heap only expands. It never shrinks. • iOS & Android still care about reserved pages. • Detail: Unused blocks of the heap remain reserved, but are paged out of the working set.
  • 41. Managed Memory: Problems (2) • Temporary memory allocations are really bad. • 1 kilobyte of allocation per frame, 60 FPS • = 60 kilobytes per second of allocation • If GC runs once per minute (BAD for framerate)… • 3600 kilobytes of memory needed!
  • 42. Tracking Managed Memory Allocations Use Unity Profiler. Sort by “GC Alloc” column. When user can interact with app, stay as close to zero as possible. (During loading, allocations aren’t as bad.)
  • 43. Memory Conservation • Reuse Collections (Lists, HashSets, etc.) • Avoid string concatenation • Reuse StringBuilders to compose strings • Avoid closures & anonymous methods
  • 44. Memory Conservation: Boxing • Happens when passing a value type as a reference type. • Value is temporarily allocated on the heap. • Example: int x = 1; object y = new object(); y.Equals(x); // Boxes “x” onto the heap
  • 45. Memory Conservation: Boxing (2) • Also happens when using enums as Dictionary keys • Example: enum MyEnum { a, b, c }; var myDictionary = new Dictionary<MyEnum, object>(); myDictionary.Add(MyEnum.a, new object()); // Boxes value “MyEnum.a” • Workaround: Implement IEqualityComparer class
  • 46. Memory Conservation: Foreach • Allocates a Enumerator when loop begins • Specific to Unity’s version of Mono • Just don’t use it.
  • 47. Memory Conservation: Unity APIs • If a Unity API returns an array, it allocates a new copy. • Every time it is accessed. • Even if the values do not change.
  • 48. Memory Conservation: Unity APIs (2) • This code allocates many Touch[] arrays. for ( int i = 0; i < Input.touches.Length; i++ ) { Touch touch = Input.touches[i]; // … }
  • 49. Memory Conservation: Unity APIs (3) • This code allocates only one copy of the Touch[] array. Touch[] touches = Input.touches; for ( int i = 0; i < touches.Length; i++ ) { Touch touch = touches[i]; // … }
  • 51. XML, JSON & other text formats • Parsing text is very slow. • Avoid parsers built on Reflection — extremely slow. • In 5.3: Use Unity’s JsonUtility class! • Three strategies to speed up data parsing.
  • 52. XML/JSON: Reduce Workload • Strategy 1: Don’t parse text. • Bake text data to binary • Use ScriptableObject • Useful for data that does not change often. • e.g. Game design parameters
  • 53. XML/JSON: Reduce Workload (2) • Strategy 2: Do less work. • Split data into smaller chunks. • Parse only the parts that are needed. • Cache parsing results for later reuse.
  • 54. XML/JSON: Reduce Workload (3) • Strategy 3: Threads. • Pure C# types only. • No Unity Assets (ScriptableObjects, Textures, etc.) • Be VERY careful.
  • 55. Large Prefabs • All GameObjects & Components in a prefab are serialized into the prefab’s data file. • Includes all settings on all Components. • 2 identical GameObjects in a prefab = 2 copies of data
  • 56. Large Prefabs (2) • For very large prefabs, split into smaller parts • Use Awake callbacks to instantiate duplicated parts
  • 57. The Resources Folder • An index of Resources is loaded at startup. • Cannot be avoided or deferred. • Solution: Move assets from Resources to Asset Bundles.
  • 59. Easy: Material/Animator/Shader Properties • Never address Material, Shader, or Animator properties by name. • Internally, hashes the property name into an integer. • Don’t do this: material.SetColor(“_Color”, Color.white); animator.SetTrigger(“attack”);
  • 60. Cached Material/Animator/Shader Properties • Do hashing at startup, cache results and reuse them. static readonly int material_Color = Shader.PropertyToID(“_Color”); static readonly int anim_Attack = Animator.StringToHash(“attack”); material.SetColor(material_Color, Color.white); animator.SetTrigger(anim_Attack);
  • 61. Boxing & String Manipulation • These are so expensive we had to mention them twice. • Slow: RegExps, String.StartsWith, String.EndsWith • Instruments: • Search for “::Box” and “_Box” • Search for “String_”
  • 64. Canvases, Draw Calls and Batching • Canvases “rebuild” their batches to reduce draw calls • Rebuilds are very expensive. • A canvas rebuilds if any Drawable component changes. • Any visual change will force a canvas to rebuild. • Drawable = anything visible on a canvas.
  • 65. Canvases, Draw Calls and Batching • Cost of a rebuild based on number of elements. • Includes children. • Frequent changes + lots of UI = lots of CPU usage!
  • 66. Reducing Batching Cost • Reduce number of Drawables. • Merge sprites, merge text objects • Split up Canvases • Balance cost of draw calls and cost of batching.
  • 67. Splitting Canvases • Can nest a canvas within another canvas • Nested canvases isolate their children from rebuilds. • Guideline: Move elements that change every frame onto separate canvases from static elements.
  • 70. Splitting Canvases: Example Change Every Frame Never Change
  • 71. Splitting Canvases: Example Dynamic Canvas Background Canvas
  • 73. Remember… • Profile before optimizing. • Apply these techniques only when needed.
  • 74. How Unity Invokes Callbacks • Internally, C++ Linked List of Components with callbacks • Update, LateUpdate, etc. • Iterate over the Linked List and invoke each callback. • Small overhead when invoking scripts
  • 75. How Unity Invokes Callbacks • If number of callbacks becomes very large, overhead can become significant. • Thousands of callbacks: 10-20% of Update CPU time
  • 76. Replacing Callbacks • Remove Update, LateUpdate, etc. • Make a GameObject with a MonoBehaviour • Implement Update, LateUpdate, and other callbacks on this object • All other code: Subscribe to needed callbacks
  • 77. Replacing Callbacks: UpdateManager object public class UpdateManager : MonoBehaviour { public static UpdateManager Instance { get; set; } void Awake() { Instance = this; } public UnityEvent OnUpdate = new UnityEvent(); void Update() { OnUpdate.Invoke(); } }
  • 78. Replacing Callbacks: Advantages • Eliminates native-to-managed trampoline overhead. • Objects can intelligently unsubscribe. • Don’t need to return out of Update callbacks! • Works well with pooled objects.