SlideShare a Scribd company logo
1 of 46
Download to read offline
Unity Internals:
Memory and Performance
Moscow, 16/05/2014
Marco Trivellato – Field Engineer
Page6/9/14 2
This Talk
Goals and Benefits
Page
Who Am I ?
•  Now Field Engineer @ Unity
•  Previously, Software Engineer
•  Mainly worked on game engines
•  Shipped several video games:
•  Captain America: Super Soldier
•  FIFA ‘07 – FIFA ’10
•  Fight Night: Round 3
6/9/14 3
Page
Topics
•  Memory Overview
•  Garbage Collection
•  Mesh Internals
•  Scripting
•  Job System
•  How to use the Profiler
6/9/14 4
Page6/9/14 5
Memory Overview
Page
Memory Domains
•  Native (internal)
•  Asset Data: Textures, AudioClips, Meshes
•  Game Objects & Components: Transform, etc..
•  Engine Internals: Managers, Rendering, Physics, etc..
•  Managed - Mono
•  Script objects (Managed dlls)
•  Wrappers for Unity objects: Game objects, assets,
components
•  Native Dlls
•  User’s dlls and external dlls (for example: DirectX)
6/9/14 6
Page
Native Memory: Internal Allocators
•  Default
•  GameObject
•  Gfx
•  Profiler
5.x: We are considering to expose an API for using a native
allocator in Dlls
6/9/14 7
Page
Managed Memory
•  Value types (bool, int, float, struct, ...)
•  Exist in stack memory. De-allocated when removed
from the stack. No Garbage.
•  Reference types (classes)
•  Exist on the heap and are handled by the mono/.net
GC. Removed when no longer being referenced.
•  Wrappers for Unity Objects :
•  GameObject
•  Assets : Texture2D, AudioClip, Mesh, …
•  Components : MeshRenderer, Transform, MonoBehaviour
6/9/14 8
Page
Mono Memory Internals
•  Allocates system heap blocks for internal allocator
•  Will allocate new heap blocks when needed
•  Heap blocks are kept in Mono for later use
•  Memory can be given back to the system after a while
•  …but it depends on the platform è don’t count on it
•  Garbage collector cleans up
•  Fragmentation can cause new heap blocks even
though memory is not exhausted
6/9/14 9
Page6/9/14 10
Garbage Collection
Page
Unity Object wrapper
•  Some Objects used in scripts have large native
backing memory in unity
•  Memory not freed until Finalizers have run
6/9/14 11
WWW
Decompression buffer
Compressed file
Decompressed file
Managed Native
Page
Mono Garbage Collection
•  GC.Collect
•  Runs on the main thread when
•  Mono exhausts the heap space
•  Or user calls System.GC.Collect()
•  Finalizers
•  Run on a separate thread
•  Controlled by mono
•  Can have several seconds delay
•  Unity native memory
•  Dispose() cleans up internal
memory
•  Eventually called from finalizer
•  Manually call Dispose() to cleanup
6/9/14 12
Main thread Finalizer thread
www = null;
new(someclass);
//no more heap
-> GC.Collect();
www.Dispose();
.....
Page
Garbage Collection
•  Roots are not collected in a GC.Collect
•  Thread stacks
•  CPU Registers
•  GC Handles (used by Unity to hold onto managed
objects)
•  Static variables!!
•  Collection time scales with managed heap size
•  The more you allocate, the slower it gets
6/9/14 13
Page
GC: does lata layout matter ?
struct Stuff
{
int a;
float b;
bool c;
string leString;
}
Stuff[] arrayOfStuff; << Everything is scanned. GC takes more time
VS
int[] As;
float[] Bs;
bool[] Cs;
string[] leStrings; << Only this is scanned. GC takes less time.
6/9/14 14
Page
GC: Best Practices
•  Reuse objects è Use object pools
•  Prefer stack-based allocations è Use struct
instead of class
•  System.GC.Collect can be used to trigger
collection
•  Calling it 6 times returns the unused memory to
the OS
•  Manually call Dispose to cleanup immediately
6/9/14 15
Page
Avoid temp allocations
•  Don’t use FindObjects or LINQ
•  Use StringBuilder for string concatenation
•  Reuse large temporary work buffers
•  ToString()
•  .tag è use CompareTag() instead
6/9/14 16
Page
Unity API Temporary Allocations
Some Examples:
•  GetComponents<T>
•  Vector3[] Mesh.vertices
•  Camera[] Camera.allCameras
•  foreach
•  does not allocate by definition
•  However, there can be a small allocation, depending on the
implementation of .GetEnumerator()
5.x: We are working on new non-allocating versions
6/9/14 17
Page
Memory fragmentation
•  Memory fragmentation is hard to account for
•  Fully unload dynamically allocated content
•  Switch to a blank scene before proceeding to next level
•  This scene could have a hook where you may pause the game
long enough to sample if there is anything significant in
memory
•  Ensure you clear out variables so GC.Collect will
remove as much as possible
•  Avoid allocations where possible
•  Reuse objects where possible within a scene play
•  Clear them out for map load to clean the memory
6/9/14 18
Page
Unloading Unused Assets
•  Resources.UnloadUnusedAssets will trigger asset
garbage collection
•  It looks for all unreferenced assets and unloads them
•  It’s an async operation
•  It’s called internally after loading a level
•  Resources.UnloadAsset is preferable
•  you need to know exactly what you need to Unload
•  Unity does not have to scan everything
•  Unity 5.0: Multi-threaded asset garbage collection
6/9/14 19
Page6/9/14 20
Mesh Internals
Memory vs. Cycles
Page
Mesh Read/Write Option
•  It allows you to modify the mesh at run-time
•  If enabled, a system-copy of the Mesh will remain in
memory
•  It is enabled by default
•  In some cases, disabling this option will not reduce the
memory usage
•  Skinned meshes
•  iOS
Unity 5.0: disable by default – under consideration
6/9/14 21
Page
Non-Uniform scaled Meshes
We need to correctly transform vertex normals
•  Unity 4.x:
•  transform the mesh on the CPU
•  create an extra copy of the data
•  Unity 5.0
•  Scaled on GPU
•  Extra memory no longer needed
6/9/14 22
Page
Static Batching
What is it ?
•  It’s an optimization that reduces number of draw
calls and state changes
How do I enable it ?
•  In the player settings + Tag the object as static
6/9/14 23
Page
Static Batching
How does it work internally ?
•  Build-time: Vertices are transformed to world-
space
•  Run-time: Index buffer is created with indices of
visible objects
Unity 5.0:
•  Re-implemented static batching without copying of
index buffers
6/9/14 24
Page
Dynamic Batching
What is it ?
•  Similar to Static Batching but it batches non-static
objects at run-time
How do I enable it ?
•  In the player settings
•  no need to tag. it auto-magically works…
6/9/14 25
Page
Dynamic Batching
How does it work internally ?
•  objects are transformed to world space on the
CPU
•  Temporary VB & IB are created
•  Rendered in one draw call
Unity 5.x: we are considering to expose per-platform
parameters
6/9/14 26
Page
Mesh Skinning
Different Implementations depending on platform:
•  x86: SSE
•  iOS/Android/WP8: Neon optimizations
•  D3D11/XBoxOne/GLES3.0: GPU
•  XBox360, WiiU: GPU (memexport)
•  PS3: SPU
•  WiiU: GPU w/ stream out
Unity 5.0: Skinned meshes use less memory by sharing
index buffers between instances
6/9/14 27
Page6/9/14 28
Scripting
Page
Unity 5.0: Mono
•  No upgrade
•  Mainly bug fixes
•  New tech in WebGL: IL2CPP
•  http://blogs.unity3d.com/2014/04/29/on-the-future-of-
web-publishing-in-unity/
•  Stay tuned: there will be a blog post about it
6/9/14 29
Page
GetComponent<T>
It asks the GameObject, for a component of the
specified type:
•  The GO contains a list of Components
•  Each Component type is compared to T
•  The first Component of type T (or that derives from
T), will be returned to the caller
•  Not too much overhead but it still needs to call into
native code
6/9/14 30
Page
Unity 5.0: Property Accessors
•  Most accessors will be removed in Unity 5.0
•  The objective is to reduce dependencies,
therefore improve modularization
•  Transform will remain
•  Existing scripts will be converted. Example:
in 5.0:
6/9/14 31
Page
Transform Component
•  this.transform is the same as GetComponent<Transform>()
•  transform.position/rotation needs to:
•  find Transform component
•  Traverse hierarchy to calculate absolute position
•  Apply translation/rotation
•  transform internally stores the position relative to the parent
•  transform.localPosition = new Vector(…) è simple
assignment
•  transform.position = new Vector(…) è costs the same if
no father, otherwise it will need to traverse the hierarchy
up to transform the abs position into local
•  finally, other components (collider, rigid body, light, camera,
etc..) will be notified via messages
6/9/14 32
Page
Instantiate
API:
•  Object Instantiate(Object, Vector3, Quaternion);
•  Object Instantiate(Object);
Implementation:
•  Clone GameObject Hierarchy and Components
•  Copy Properties
•  Awake
•  Apply new Transform (if provided)
6/9/14 33
Page
Instantiate cont..ed
•  Awake can be expensive
•  AwakeFromLoad (main thread)
•  clear states
•  internal state caching
•  pre-compute
Unity 5.0:
•  Allocations have been reduced
•  Some inner loops for copying the data have been
optimized
6/9/14 34
Page
JIT Compilation
What is it ?
•  The process in which machine code is generated from CIL
code during the application's run-time
Pros:
•  It generates optimized code for the current platform
Cons:
•  Each time a method is called for the first time, the
application will suffer a certain performance penalty because
of the compilation
6/9/14 35
Page
JIT compilation spikes
What about pre-JITting ?
•  RuntimeHelpers.PrepareMethod does not work:
…better to use MethodHandle.GetFunctionPointer()
6/9/14 36
Page6/9/14 37
Job System
Page
Unity 5.0: Job System (internal)
The goals of the job system:
•  make it easy to write very efficient job based
multithreaded code
•  The jobs should be able to run safely in parallel to
script code
6/9/14 38
Page
Job System: Why ?
Modern architectures are multi-core:
•  XBox 360: 3 cores
•  PS4/Xbox One: 8 cores
…which includes mobile devices:
•  iPhone 4S: 2 cores
•  Galaxy S3: 4 cores
6/9/14 39
Page
Job System: What is it ?
•  It’s a Framework that we are going to use in
existing and new sub-systems
•  We want to have Animation, NavMesh, Occlusion,
Rendering, etc… run as much as possible in
parallel
•  This will ultimately lead to better performance
6/9/14 40
Page
Unity 5.0: Profiler Timeline View
It’s a tool that allows you to analyse internal (native)
threads execution of a specific frame
6/9/14 41
Page
Unity 5.0: Frame Debugger
6/9/14 42
Page6/9/14 43
Conclusions
Page
Budgeting Memory
How much memory is available ?
•  It depends…
•  For example, on 512mb devices running iOS 6.0:
~250mb. A bit less with iOS 7.0
What’s the baseline ?
•  Create an empty scene and measure memory
•  Don’t forget that the profiler requires some
memory
•  For example: on Android 15.5mb (+ 12mb profiler)
6/9/14 44
Page
Profiling
•  Don’t make assumptions
•  Profile on target device
•  Editor != Player
•  Platform X != Platform Y
•  Managed Memory is not returned to Native Land!
For best results…:
•  Profile early and regularly
6/9/14 45
Page6/9/14 46
Questions ?
marcot@unity3d.com - Twitter: @m_trive

More Related Content

What's hot

How we optimized our Game - Jake & Tess' Finding Monsters Adventure
How we optimized our Game - Jake & Tess' Finding Monsters AdventureHow we optimized our Game - Jake & Tess' Finding Monsters Adventure
How we optimized our Game - Jake & Tess' Finding Monsters AdventureFelipe Lira
 
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...Gerke Max Preussner
 
Unreal Open Day 2017 Optimize in Mobile UI
Unreal Open Day 2017 Optimize in Mobile UIUnreal Open Day 2017 Optimize in Mobile UI
Unreal Open Day 2017 Optimize in Mobile UIEpic Games China
 
게임에서 흔히 쓰이는 최적화 전략 by 엄윤섭 @ 지스타 컨퍼런스 2013
게임에서 흔히 쓰이는 최적화 전략 by 엄윤섭 @ 지스타 컨퍼런스 2013게임에서 흔히 쓰이는 최적화 전략 by 엄윤섭 @ 지스타 컨퍼런스 2013
게임에서 흔히 쓰이는 최적화 전략 by 엄윤섭 @ 지스타 컨퍼런스 2013영욱 오
 
【Unite Tokyo 2018】その最適化、本当に最適ですか!? ~正しい最適化を行うためのテクニック~
【Unite Tokyo 2018】その最適化、本当に最適ですか!? ~正しい最適化を行うためのテクニック~【Unite Tokyo 2018】その最適化、本当に最適ですか!? ~正しい最適化を行うためのテクニック~
【Unite Tokyo 2018】その最適化、本当に最適ですか!? ~正しい最適化を行うためのテクニック~Unity Technologies Japan K.K.
 
[UniteKorea2013] Memory profiling in Unity
[UniteKorea2013] Memory profiling in Unity[UniteKorea2013] Memory profiling in Unity
[UniteKorea2013] Memory profiling in UnityWilliam Hugo Yang
 
Optimization Deep Dive: Unreal Engine 4 on Intel
Optimization Deep Dive: Unreal Engine 4 on IntelOptimization Deep Dive: Unreal Engine 4 on Intel
Optimization Deep Dive: Unreal Engine 4 on IntelIntel® Software
 
Unity - Internals: memory and performance
Unity - Internals: memory and performanceUnity - Internals: memory and performance
Unity - Internals: memory and performanceCodemotion
 
Windows Registered I/O (RIO) vs IOCP
Windows Registered I/O (RIO) vs IOCPWindows Registered I/O (RIO) vs IOCP
Windows Registered I/O (RIO) vs IOCPSeungmo Koo
 
【Unite Tokyo 2018】Audio機能の基礎と実装テクニック
【Unite Tokyo 2018】Audio機能の基礎と実装テクニック【Unite Tokyo 2018】Audio機能の基礎と実装テクニック
【Unite Tokyo 2018】Audio機能の基礎と実装テクニックUnityTechnologiesJapan002
 
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭するCEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭するYoshifumi Kawai
 
Deep Dive async/await in Unity with UniTask(UniRx.Async)
Deep Dive async/await in Unity with UniTask(UniRx.Async)Deep Dive async/await in Unity with UniTask(UniRx.Async)
Deep Dive async/await in Unity with UniTask(UniRx.Async)Yoshifumi Kawai
 
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
 
Unityでパフォーマンスの良いUIを作る為のTips
Unityでパフォーマンスの良いUIを作る為のTipsUnityでパフォーマンスの良いUIを作る為のTips
Unityでパフォーマンスの良いUIを作る為のTipsUnity Technologies Japan K.K.
 
【Unite Tokyo 2019】Unityだったら簡単!マルチプレイ用ゲームサーバ開発 ~実践編~
【Unite Tokyo 2019】Unityだったら簡単!マルチプレイ用ゲームサーバ開発 ~実践編~【Unite Tokyo 2019】Unityだったら簡単!マルチプレイ用ゲームサーバ開発 ~実践編~
【Unite Tokyo 2019】Unityだったら簡単!マルチプレイ用ゲームサーバ開発 ~実践編~UnityTechnologiesJapan002
 
【Unite Tokyo 2018】実践的なパフォーマンス分析と最適化
【Unite Tokyo 2018】実践的なパフォーマンス分析と最適化【Unite Tokyo 2018】実践的なパフォーマンス分析と最適化
【Unite Tokyo 2018】実践的なパフォーマンス分析と最適化Unity Technologies Japan K.K.
 
アニメーションとスキニングをBurstで独自実装する.pdf
アニメーションとスキニングをBurstで独自実装する.pdfアニメーションとスキニングをBurstで独自実装する.pdf
アニメーションとスキニングをBurstで独自実装する.pdfinfinite_loop
 
UniTask入門
UniTask入門UniTask入門
UniTask入門torisoup
 
Unity 2018-2019を見据えたDeNAのUnity開発のこれから [DeNA TechCon 2019]
Unity 2018-2019を見据えたDeNAのUnity開発のこれから [DeNA TechCon 2019]Unity 2018-2019を見据えたDeNAのUnity開発のこれから [DeNA TechCon 2019]
Unity 2018-2019を見据えたDeNAのUnity開発のこれから [DeNA TechCon 2019]DeNA
 

What's hot (20)

How we optimized our Game - Jake & Tess' Finding Monsters Adventure
How we optimized our Game - Jake & Tess' Finding Monsters AdventureHow we optimized our Game - Jake & Tess' Finding Monsters Adventure
How we optimized our Game - Jake & Tess' Finding Monsters Adventure
 
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
 
Unreal Open Day 2017 Optimize in Mobile UI
Unreal Open Day 2017 Optimize in Mobile UIUnreal Open Day 2017 Optimize in Mobile UI
Unreal Open Day 2017 Optimize in Mobile UI
 
게임에서 흔히 쓰이는 최적화 전략 by 엄윤섭 @ 지스타 컨퍼런스 2013
게임에서 흔히 쓰이는 최적화 전략 by 엄윤섭 @ 지스타 컨퍼런스 2013게임에서 흔히 쓰이는 최적화 전략 by 엄윤섭 @ 지스타 컨퍼런스 2013
게임에서 흔히 쓰이는 최적화 전략 by 엄윤섭 @ 지스타 컨퍼런스 2013
 
【Unite Tokyo 2018】その最適化、本当に最適ですか!? ~正しい最適化を行うためのテクニック~
【Unite Tokyo 2018】その最適化、本当に最適ですか!? ~正しい最適化を行うためのテクニック~【Unite Tokyo 2018】その最適化、本当に最適ですか!? ~正しい最適化を行うためのテクニック~
【Unite Tokyo 2018】その最適化、本当に最適ですか!? ~正しい最適化を行うためのテクニック~
 
[UniteKorea2013] Memory profiling in Unity
[UniteKorea2013] Memory profiling in Unity[UniteKorea2013] Memory profiling in Unity
[UniteKorea2013] Memory profiling in Unity
 
Optimization Deep Dive: Unreal Engine 4 on Intel
Optimization Deep Dive: Unreal Engine 4 on IntelOptimization Deep Dive: Unreal Engine 4 on Intel
Optimization Deep Dive: Unreal Engine 4 on Intel
 
Unity - Internals: memory and performance
Unity - Internals: memory and performanceUnity - Internals: memory and performance
Unity - Internals: memory and performance
 
Windows Registered I/O (RIO) vs IOCP
Windows Registered I/O (RIO) vs IOCPWindows Registered I/O (RIO) vs IOCP
Windows Registered I/O (RIO) vs IOCP
 
【Unite Tokyo 2018】Audio機能の基礎と実装テクニック
【Unite Tokyo 2018】Audio機能の基礎と実装テクニック【Unite Tokyo 2018】Audio機能の基礎と実装テクニック
【Unite Tokyo 2018】Audio機能の基礎と実装テクニック
 
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭するCEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
 
Deep Dive async/await in Unity with UniTask(UniRx.Async)
Deep Dive async/await in Unity with UniTask(UniRx.Async)Deep Dive async/await in Unity with UniTask(UniRx.Async)
Deep Dive async/await in Unity with UniTask(UniRx.Async)
 
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...
 
Unityでパフォーマンスの良いUIを作る為のTips
Unityでパフォーマンスの良いUIを作る為のTipsUnityでパフォーマンスの良いUIを作る為のTips
Unityでパフォーマンスの良いUIを作る為のTips
 
【Unite Tokyo 2019】Unityだったら簡単!マルチプレイ用ゲームサーバ開発 ~実践編~
【Unite Tokyo 2019】Unityだったら簡単!マルチプレイ用ゲームサーバ開発 ~実践編~【Unite Tokyo 2019】Unityだったら簡単!マルチプレイ用ゲームサーバ開発 ~実践編~
【Unite Tokyo 2019】Unityだったら簡単!マルチプレイ用ゲームサーバ開発 ~実践編~
 
【Unite Tokyo 2018】実践的なパフォーマンス分析と最適化
【Unite Tokyo 2018】実践的なパフォーマンス分析と最適化【Unite Tokyo 2018】実践的なパフォーマンス分析と最適化
【Unite Tokyo 2018】実践的なパフォーマンス分析と最適化
 
アニメーションとスキニングをBurstで独自実装する.pdf
アニメーションとスキニングをBurstで独自実装する.pdfアニメーションとスキニングをBurstで独自実装する.pdf
アニメーションとスキニングをBurstで独自実装する.pdf
 
UniTask入門
UniTask入門UniTask入門
UniTask入門
 
Beyond porting
Beyond portingBeyond porting
Beyond porting
 
Unity 2018-2019を見据えたDeNAのUnity開発のこれから [DeNA TechCon 2019]
Unity 2018-2019を見据えたDeNAのUnity開発のこれから [DeNA TechCon 2019]Unity 2018-2019を見据えたDeNAのUnity開発のこれから [DeNA TechCon 2019]
Unity 2018-2019を見据えたDeNAのUnity開発のこれから [DeNA TechCon 2019]
 

Viewers also liked

Unity Optimization Tips, Tricks and Tools
Unity Optimization Tips, Tricks and ToolsUnity Optimization Tips, Tricks and Tools
Unity Optimization Tips, Tricks and ToolsIntel® Software
 
EA: Optimization of mobile Unity application
EA: Optimization of mobile Unity applicationEA: Optimization of mobile Unity application
EA: Optimization of mobile Unity applicationDevGAMM Conference
 
Mobile Performance Tuning: Poor Man's Tips And Tricks
Mobile Performance Tuning: Poor Man's Tips And TricksMobile Performance Tuning: Poor Man's Tips And Tricks
Mobile Performance Tuning: Poor Man's Tips And TricksValentin Simonov
 
Optimizing Large Scenes in Unity
Optimizing Large Scenes in UnityOptimizing Large Scenes in Unity
Optimizing Large Scenes in UnityNoam Gat
 
Unity3D Tips and Tricks or "You are doing it wrong!"
Unity3D Tips and Tricks or "You are doing it wrong!"Unity3D Tips and Tricks or "You are doing it wrong!"
Unity3D Tips and Tricks or "You are doing it wrong!"Taras Leskiv
 
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) NDC15 Ver.
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) NDC15 Ver.유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) NDC15 Ver.
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) NDC15 Ver.ozlael ozlael
 
Performance and Memory Management improvement applying Design Patterns at Unity.
Performance and Memory Management improvement applying Design Patterns at Unity.Performance and Memory Management improvement applying Design Patterns at Unity.
Performance and Memory Management improvement applying Design Patterns at Unity.Lucy Gomez
 
[Unite2015 박민근] 유니티 최적화 테크닉 총정리
[Unite2015 박민근] 유니티 최적화 테크닉 총정리[Unite2015 박민근] 유니티 최적화 테크닉 총정리
[Unite2015 박민근] 유니티 최적화 테크닉 총정리MinGeun Park
 
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.ozlael ozlael
 
Mono for Game Developers - AltDevConf 2012
Mono for Game Developers - AltDevConf 2012Mono for Game Developers - AltDevConf 2012
Mono for Game Developers - AltDevConf 2012Xamarin
 
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)Kyuseok Hwang(allosha)
 
Avoid loss of hair while coding Unity3D plugin for mobile
Avoid loss of hair while coding Unity3D plugin for mobileAvoid loss of hair while coding Unity3D plugin for mobile
Avoid loss of hair while coding Unity3D plugin for mobileValerio Riva
 
Тарас Леськів “Game Programming Patterns and Unity”
Тарас Леськів “Game Programming Patterns and Unity”Тарас Леськів “Game Programming Patterns and Unity”
Тарас Леськів “Game Programming Patterns and Unity”Lviv Startup Club
 
製作 Unity Plugin for iOS
製作 Unity Plugin for iOS製作 Unity Plugin for iOS
製作 Unity Plugin for iOSJohnny Sung
 
Fast and energy-efficient eNVM based memory organisation at L3-L1 layers for ...
Fast and energy-efficient eNVM based memory organisation at L3-L1 layers for ...Fast and energy-efficient eNVM based memory organisation at L3-L1 layers for ...
Fast and energy-efficient eNVM based memory organisation at L3-L1 layers for ...Facultad de Informática UCM
 
Unity Editor Extensions for project automatization
Unity Editor Extensions for project automatizationUnity Editor Extensions for project automatization
Unity Editor Extensions for project automatizationDevGAMM Conference
 
Unity5 사용기
Unity5 사용기Unity5 사용기
Unity5 사용기은아 정
 
Software Engineer- A unity 3d Game
Software Engineer- A unity 3d GameSoftware Engineer- A unity 3d Game
Software Engineer- A unity 3d GameIsfand yar Khan
 
Unity 3D Runtime Animation Generation
Unity 3D Runtime Animation GenerationUnity 3D Runtime Animation Generation
Unity 3D Runtime Animation GenerationDustin Graham
 

Viewers also liked (20)

Unity Optimization Tips, Tricks and Tools
Unity Optimization Tips, Tricks and ToolsUnity Optimization Tips, Tricks and Tools
Unity Optimization Tips, Tricks and Tools
 
EA: Optimization of mobile Unity application
EA: Optimization of mobile Unity applicationEA: Optimization of mobile Unity application
EA: Optimization of mobile Unity application
 
Mobile Performance Tuning: Poor Man's Tips And Tricks
Mobile Performance Tuning: Poor Man's Tips And TricksMobile Performance Tuning: Poor Man's Tips And Tricks
Mobile Performance Tuning: Poor Man's Tips And Tricks
 
Optimizing Large Scenes in Unity
Optimizing Large Scenes in UnityOptimizing Large Scenes in Unity
Optimizing Large Scenes in Unity
 
Unity3D Tips and Tricks or "You are doing it wrong!"
Unity3D Tips and Tricks or "You are doing it wrong!"Unity3D Tips and Tricks or "You are doing it wrong!"
Unity3D Tips and Tricks or "You are doing it wrong!"
 
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) NDC15 Ver.
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) NDC15 Ver.유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) NDC15 Ver.
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) NDC15 Ver.
 
Performance and Memory Management improvement applying Design Patterns at Unity.
Performance and Memory Management improvement applying Design Patterns at Unity.Performance and Memory Management improvement applying Design Patterns at Unity.
Performance and Memory Management improvement applying Design Patterns at Unity.
 
[Unite2015 박민근] 유니티 최적화 테크닉 총정리
[Unite2015 박민근] 유니티 최적화 테크닉 총정리[Unite2015 박민근] 유니티 최적화 테크닉 총정리
[Unite2015 박민근] 유니티 최적화 테크닉 총정리
 
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.
유니티 그래픽 최적화, 어디까지 해봤니 (Optimizing Unity Graphics) Unite Seoul Ver.
 
Mono for Game Developers - AltDevConf 2012
Mono for Game Developers - AltDevConf 2012Mono for Game Developers - AltDevConf 2012
Mono for Game Developers - AltDevConf 2012
 
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)
Shaderx5 2.6normalmappingwithoutprecomputedtangents 130318 (1)
 
Avoid loss of hair while coding Unity3D plugin for mobile
Avoid loss of hair while coding Unity3D plugin for mobileAvoid loss of hair while coding Unity3D plugin for mobile
Avoid loss of hair while coding Unity3D plugin for mobile
 
Тарас Леськів “Game Programming Patterns and Unity”
Тарас Леськів “Game Programming Patterns and Unity”Тарас Леськів “Game Programming Patterns and Unity”
Тарас Леськів “Game Programming Patterns and Unity”
 
Memory Pools for C and C++
Memory Pools for C and C++Memory Pools for C and C++
Memory Pools for C and C++
 
製作 Unity Plugin for iOS
製作 Unity Plugin for iOS製作 Unity Plugin for iOS
製作 Unity Plugin for iOS
 
Fast and energy-efficient eNVM based memory organisation at L3-L1 layers for ...
Fast and energy-efficient eNVM based memory organisation at L3-L1 layers for ...Fast and energy-efficient eNVM based memory organisation at L3-L1 layers for ...
Fast and energy-efficient eNVM based memory organisation at L3-L1 layers for ...
 
Unity Editor Extensions for project automatization
Unity Editor Extensions for project automatizationUnity Editor Extensions for project automatization
Unity Editor Extensions for project automatization
 
Unity5 사용기
Unity5 사용기Unity5 사용기
Unity5 사용기
 
Software Engineer- A unity 3d Game
Software Engineer- A unity 3d GameSoftware Engineer- A unity 3d Game
Software Engineer- A unity 3d Game
 
Unity 3D Runtime Animation Generation
Unity 3D Runtime Animation GenerationUnity 3D Runtime Animation Generation
Unity 3D Runtime Animation Generation
 

Similar to Unity Internals: Memory and Performance

【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法Unite2017Tokyo
 
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法Unity Technologies Japan K.K.
 
Things I wish I knew about GemStone
Things I wish I knew about GemStoneThings I wish I knew about GemStone
Things I wish I knew about GemStoneESUG
 
Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)MongoDB
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage SystemsSATOSHI TAGOMORI
 
[NetherRealm Studios] Game Studio Perforce Architecture
[NetherRealm Studios] Game Studio Perforce Architecture[NetherRealm Studios] Game Studio Perforce Architecture
[NetherRealm Studios] Game Studio Perforce ArchitecturePerforce
 
Ansiblefest 2018 Network automation journey at roblox
Ansiblefest 2018 Network automation journey at robloxAnsiblefest 2018 Network automation journey at roblox
Ansiblefest 2018 Network automation journey at robloxDamien Garros
 
Ironic 140622212631-phpapp02
Ironic 140622212631-phpapp02Ironic 140622212631-phpapp02
Ironic 140622212631-phpapp02Narender Kumar
 
Ironic 140622212631-phpapp02
Ironic 140622212631-phpapp02Ironic 140622212631-phpapp02
Ironic 140622212631-phpapp02Narender Kumar
 
ABS 2014 - Android Kit Kat Internals
ABS 2014 - Android Kit Kat InternalsABS 2014 - Android Kit Kat Internals
ABS 2014 - Android Kit Kat InternalsBenjamin Zores
 
Virtualization VM VirtualBox + Oracle Enterprise Linux With Oracle 11GR2
Virtualization VM VirtualBox + Oracle Enterprise Linux With Oracle 11GR2Virtualization VM VirtualBox + Oracle Enterprise Linux With Oracle 11GR2
Virtualization VM VirtualBox + Oracle Enterprise Linux With Oracle 11GR2John Heaton
 
Data Management and Streaming Strategies in Drakensang Online
Data Management and Streaming Strategies in Drakensang OnlineData Management and Streaming Strategies in Drakensang Online
Data Management and Streaming Strategies in Drakensang OnlineAndre Weissflog
 
Deployment Strategies
Deployment StrategiesDeployment Strategies
Deployment StrategiesMongoDB
 
XPDS13: Zero-copy display of guest framebuffers using GEM - John Baboval, Citrix
XPDS13: Zero-copy display of guest framebuffers using GEM - John Baboval, CitrixXPDS13: Zero-copy display of guest framebuffers using GEM - John Baboval, Citrix
XPDS13: Zero-copy display of guest framebuffers using GEM - John Baboval, CitrixThe Linux Foundation
 
Lec 10-linux-review
Lec 10-linux-reviewLec 10-linux-review
Lec 10-linux-reviewabinaya m
 
Deployment Strategy
Deployment StrategyDeployment Strategy
Deployment StrategyMongoDB
 

Similar to Unity Internals: Memory and Performance (20)

【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
 
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
 
Things I wish I knew about GemStone
Things I wish I knew about GemStoneThings I wish I knew about GemStone
Things I wish I knew about GemStone
 
memory_mapping.ppt
memory_mapping.pptmemory_mapping.ppt
memory_mapping.ppt
 
Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
 
[NetherRealm Studios] Game Studio Perforce Architecture
[NetherRealm Studios] Game Studio Perforce Architecture[NetherRealm Studios] Game Studio Perforce Architecture
[NetherRealm Studios] Game Studio Perforce Architecture
 
Ansiblefest 2018 Network automation journey at roblox
Ansiblefest 2018 Network automation journey at robloxAnsiblefest 2018 Network automation journey at roblox
Ansiblefest 2018 Network automation journey at roblox
 
Ironic 140622212631-phpapp02
Ironic 140622212631-phpapp02Ironic 140622212631-phpapp02
Ironic 140622212631-phpapp02
 
Ironic
IronicIronic
Ironic
 
Ironic 140622212631-phpapp02
Ironic 140622212631-phpapp02Ironic 140622212631-phpapp02
Ironic 140622212631-phpapp02
 
ABS 2014 - Android Kit Kat Internals
ABS 2014 - Android Kit Kat InternalsABS 2014 - Android Kit Kat Internals
ABS 2014 - Android Kit Kat Internals
 
Virtualization VM VirtualBox + Oracle Enterprise Linux With Oracle 11GR2
Virtualization VM VirtualBox + Oracle Enterprise Linux With Oracle 11GR2Virtualization VM VirtualBox + Oracle Enterprise Linux With Oracle 11GR2
Virtualization VM VirtualBox + Oracle Enterprise Linux With Oracle 11GR2
 
Tuning Linux for MongoDB
Tuning Linux for MongoDBTuning Linux for MongoDB
Tuning Linux for MongoDB
 
FreeBSD hosting
FreeBSD hostingFreeBSD hosting
FreeBSD hosting
 
Data Management and Streaming Strategies in Drakensang Online
Data Management and Streaming Strategies in Drakensang OnlineData Management and Streaming Strategies in Drakensang Online
Data Management and Streaming Strategies in Drakensang Online
 
Deployment Strategies
Deployment StrategiesDeployment Strategies
Deployment Strategies
 
XPDS13: Zero-copy display of guest framebuffers using GEM - John Baboval, Citrix
XPDS13: Zero-copy display of guest framebuffers using GEM - John Baboval, CitrixXPDS13: Zero-copy display of guest framebuffers using GEM - John Baboval, Citrix
XPDS13: Zero-copy display of guest framebuffers using GEM - John Baboval, Citrix
 
Lec 10-linux-review
Lec 10-linux-reviewLec 10-linux-review
Lec 10-linux-review
 
Deployment Strategy
Deployment StrategyDeployment Strategy
Deployment Strategy
 

More from DevGAMM Conference

The art of small steps, or how to make sound for games in conditions of war /...
The art of small steps, or how to make sound for games in conditions of war /...The art of small steps, or how to make sound for games in conditions of war /...
The art of small steps, or how to make sound for games in conditions of war /...DevGAMM Conference
 
Breaking up with FMOD - Why we ended things and embraced Metasounds / Daniel ...
Breaking up with FMOD - Why we ended things and embraced Metasounds / Daniel ...Breaking up with FMOD - Why we ended things and embraced Metasounds / Daniel ...
Breaking up with FMOD - Why we ended things and embraced Metasounds / Daniel ...DevGAMM Conference
 
How Audio Objects Improve Spatial Accuracy / Mads Maretty Sønderup (Audiokine...
How Audio Objects Improve Spatial Accuracy / Mads Maretty Sønderup (Audiokine...How Audio Objects Improve Spatial Accuracy / Mads Maretty Sønderup (Audiokine...
How Audio Objects Improve Spatial Accuracy / Mads Maretty Sønderup (Audiokine...DevGAMM Conference
 
Why indie developers should consider hyper-casual right now / Igor Gurenyov (...
Why indie developers should consider hyper-casual right now / Igor Gurenyov (...Why indie developers should consider hyper-casual right now / Igor Gurenyov (...
Why indie developers should consider hyper-casual right now / Igor Gurenyov (...DevGAMM Conference
 
AI / ML for Indies / Tyler Coleman (Retora Games)
AI / ML for Indies / Tyler Coleman (Retora Games)AI / ML for Indies / Tyler Coleman (Retora Games)
AI / ML for Indies / Tyler Coleman (Retora Games)DevGAMM Conference
 
Agility is the Key: Power Up Your GameDev Project Management with Agile Pract...
Agility is the Key: Power Up Your GameDev Project Management with Agile Pract...Agility is the Key: Power Up Your GameDev Project Management with Agile Pract...
Agility is the Key: Power Up Your GameDev Project Management with Agile Pract...DevGAMM Conference
 
New PR Tech and AI Tools for 2023: A Game Changer for Outreach / Kirill Perev...
New PR Tech and AI Tools for 2023: A Game Changer for Outreach / Kirill Perev...New PR Tech and AI Tools for 2023: A Game Changer for Outreach / Kirill Perev...
New PR Tech and AI Tools for 2023: A Game Changer for Outreach / Kirill Perev...DevGAMM Conference
 
Playable Ads - Revolutionizing mobile games advertising / Jakub Kukuryk (Popc...
Playable Ads - Revolutionizing mobile games advertising / Jakub Kukuryk (Popc...Playable Ads - Revolutionizing mobile games advertising / Jakub Kukuryk (Popc...
Playable Ads - Revolutionizing mobile games advertising / Jakub Kukuryk (Popc...DevGAMM Conference
 
Creative Collaboration: Managing an Art Team / Nastassia Radzivonava (Glera G...
Creative Collaboration: Managing an Art Team / Nastassia Radzivonava (Glera G...Creative Collaboration: Managing an Art Team / Nastassia Radzivonava (Glera G...
Creative Collaboration: Managing an Art Team / Nastassia Radzivonava (Glera G...DevGAMM Conference
 
From Local to Global: Unleashing the Power of Payments / Jan Kuhlmannn (Xsolla)
From Local to Global: Unleashing the Power of Payments / Jan Kuhlmannn (Xsolla)From Local to Global: Unleashing the Power of Payments / Jan Kuhlmannn (Xsolla)
From Local to Global: Unleashing the Power of Payments / Jan Kuhlmannn (Xsolla)DevGAMM Conference
 
Strategies and case studies to grow LTV in 2023 / Julia Iljuk (Balancy)
Strategies and case studies to grow LTV in 2023 / Julia Iljuk (Balancy)Strategies and case studies to grow LTV in 2023 / Julia Iljuk (Balancy)
Strategies and case studies to grow LTV in 2023 / Julia Iljuk (Balancy)DevGAMM Conference
 
Why is ASO not working in 2023 and how to change it? / Olena Vedmedenko (Keya...
Why is ASO not working in 2023 and how to change it? / Olena Vedmedenko (Keya...Why is ASO not working in 2023 and how to change it? / Olena Vedmedenko (Keya...
Why is ASO not working in 2023 and how to change it? / Olena Vedmedenko (Keya...DevGAMM Conference
 
How to increase wishlists & game sales from China? Growth marketing tactics &...
How to increase wishlists & game sales from China? Growth marketing tactics &...How to increase wishlists & game sales from China? Growth marketing tactics &...
How to increase wishlists & game sales from China? Growth marketing tactics &...DevGAMM Conference
 
Turkish Gaming Industry and HR Insights / Mustafa Mert EFE (Zindhu)
Turkish Gaming Industry and HR Insights / Mustafa Mert EFE (Zindhu)Turkish Gaming Industry and HR Insights / Mustafa Mert EFE (Zindhu)
Turkish Gaming Industry and HR Insights / Mustafa Mert EFE (Zindhu)DevGAMM Conference
 
Building an Awesome Creative Team from Scratch, Capable of Scaling Up / Sasha...
Building an Awesome Creative Team from Scratch, Capable of Scaling Up / Sasha...Building an Awesome Creative Team from Scratch, Capable of Scaling Up / Sasha...
Building an Awesome Creative Team from Scratch, Capable of Scaling Up / Sasha...DevGAMM Conference
 
Seven Reasons Why Your LiveOps Is Not Performing / Alexander Devyaterikov (Be...
Seven Reasons Why Your LiveOps Is Not Performing / Alexander Devyaterikov (Be...Seven Reasons Why Your LiveOps Is Not Performing / Alexander Devyaterikov (Be...
Seven Reasons Why Your LiveOps Is Not Performing / Alexander Devyaterikov (Be...DevGAMM Conference
 
The Power of Game and Music Collaborations: Reaching and Engaging the Masses ...
The Power of Game and Music Collaborations: Reaching and Engaging the Masses ...The Power of Game and Music Collaborations: Reaching and Engaging the Masses ...
The Power of Game and Music Collaborations: Reaching and Engaging the Masses ...DevGAMM Conference
 
Branded Content: How to overcome players' immunity to advertising / Alex Brod...
Branded Content: How to overcome players' immunity to advertising / Alex Brod...Branded Content: How to overcome players' immunity to advertising / Alex Brod...
Branded Content: How to overcome players' immunity to advertising / Alex Brod...DevGAMM Conference
 
Resurrecting Chasm: The Rift - A Source-less Remastering Journey / Gennadii P...
Resurrecting Chasm: The Rift - A Source-less Remastering Journey / Gennadii P...Resurrecting Chasm: The Rift - A Source-less Remastering Journey / Gennadii P...
Resurrecting Chasm: The Rift - A Source-less Remastering Journey / Gennadii P...DevGAMM Conference
 
How NOT to do showcase events: Behind the scenes of Midnight Show / Andrew Ko...
How NOT to do showcase events: Behind the scenes of Midnight Show / Andrew Ko...How NOT to do showcase events: Behind the scenes of Midnight Show / Andrew Ko...
How NOT to do showcase events: Behind the scenes of Midnight Show / Andrew Ko...DevGAMM Conference
 

More from DevGAMM Conference (20)

The art of small steps, or how to make sound for games in conditions of war /...
The art of small steps, or how to make sound for games in conditions of war /...The art of small steps, or how to make sound for games in conditions of war /...
The art of small steps, or how to make sound for games in conditions of war /...
 
Breaking up with FMOD - Why we ended things and embraced Metasounds / Daniel ...
Breaking up with FMOD - Why we ended things and embraced Metasounds / Daniel ...Breaking up with FMOD - Why we ended things and embraced Metasounds / Daniel ...
Breaking up with FMOD - Why we ended things and embraced Metasounds / Daniel ...
 
How Audio Objects Improve Spatial Accuracy / Mads Maretty Sønderup (Audiokine...
How Audio Objects Improve Spatial Accuracy / Mads Maretty Sønderup (Audiokine...How Audio Objects Improve Spatial Accuracy / Mads Maretty Sønderup (Audiokine...
How Audio Objects Improve Spatial Accuracy / Mads Maretty Sønderup (Audiokine...
 
Why indie developers should consider hyper-casual right now / Igor Gurenyov (...
Why indie developers should consider hyper-casual right now / Igor Gurenyov (...Why indie developers should consider hyper-casual right now / Igor Gurenyov (...
Why indie developers should consider hyper-casual right now / Igor Gurenyov (...
 
AI / ML for Indies / Tyler Coleman (Retora Games)
AI / ML for Indies / Tyler Coleman (Retora Games)AI / ML for Indies / Tyler Coleman (Retora Games)
AI / ML for Indies / Tyler Coleman (Retora Games)
 
Agility is the Key: Power Up Your GameDev Project Management with Agile Pract...
Agility is the Key: Power Up Your GameDev Project Management with Agile Pract...Agility is the Key: Power Up Your GameDev Project Management with Agile Pract...
Agility is the Key: Power Up Your GameDev Project Management with Agile Pract...
 
New PR Tech and AI Tools for 2023: A Game Changer for Outreach / Kirill Perev...
New PR Tech and AI Tools for 2023: A Game Changer for Outreach / Kirill Perev...New PR Tech and AI Tools for 2023: A Game Changer for Outreach / Kirill Perev...
New PR Tech and AI Tools for 2023: A Game Changer for Outreach / Kirill Perev...
 
Playable Ads - Revolutionizing mobile games advertising / Jakub Kukuryk (Popc...
Playable Ads - Revolutionizing mobile games advertising / Jakub Kukuryk (Popc...Playable Ads - Revolutionizing mobile games advertising / Jakub Kukuryk (Popc...
Playable Ads - Revolutionizing mobile games advertising / Jakub Kukuryk (Popc...
 
Creative Collaboration: Managing an Art Team / Nastassia Radzivonava (Glera G...
Creative Collaboration: Managing an Art Team / Nastassia Radzivonava (Glera G...Creative Collaboration: Managing an Art Team / Nastassia Radzivonava (Glera G...
Creative Collaboration: Managing an Art Team / Nastassia Radzivonava (Glera G...
 
From Local to Global: Unleashing the Power of Payments / Jan Kuhlmannn (Xsolla)
From Local to Global: Unleashing the Power of Payments / Jan Kuhlmannn (Xsolla)From Local to Global: Unleashing the Power of Payments / Jan Kuhlmannn (Xsolla)
From Local to Global: Unleashing the Power of Payments / Jan Kuhlmannn (Xsolla)
 
Strategies and case studies to grow LTV in 2023 / Julia Iljuk (Balancy)
Strategies and case studies to grow LTV in 2023 / Julia Iljuk (Balancy)Strategies and case studies to grow LTV in 2023 / Julia Iljuk (Balancy)
Strategies and case studies to grow LTV in 2023 / Julia Iljuk (Balancy)
 
Why is ASO not working in 2023 and how to change it? / Olena Vedmedenko (Keya...
Why is ASO not working in 2023 and how to change it? / Olena Vedmedenko (Keya...Why is ASO not working in 2023 and how to change it? / Olena Vedmedenko (Keya...
Why is ASO not working in 2023 and how to change it? / Olena Vedmedenko (Keya...
 
How to increase wishlists & game sales from China? Growth marketing tactics &...
How to increase wishlists & game sales from China? Growth marketing tactics &...How to increase wishlists & game sales from China? Growth marketing tactics &...
How to increase wishlists & game sales from China? Growth marketing tactics &...
 
Turkish Gaming Industry and HR Insights / Mustafa Mert EFE (Zindhu)
Turkish Gaming Industry and HR Insights / Mustafa Mert EFE (Zindhu)Turkish Gaming Industry and HR Insights / Mustafa Mert EFE (Zindhu)
Turkish Gaming Industry and HR Insights / Mustafa Mert EFE (Zindhu)
 
Building an Awesome Creative Team from Scratch, Capable of Scaling Up / Sasha...
Building an Awesome Creative Team from Scratch, Capable of Scaling Up / Sasha...Building an Awesome Creative Team from Scratch, Capable of Scaling Up / Sasha...
Building an Awesome Creative Team from Scratch, Capable of Scaling Up / Sasha...
 
Seven Reasons Why Your LiveOps Is Not Performing / Alexander Devyaterikov (Be...
Seven Reasons Why Your LiveOps Is Not Performing / Alexander Devyaterikov (Be...Seven Reasons Why Your LiveOps Is Not Performing / Alexander Devyaterikov (Be...
Seven Reasons Why Your LiveOps Is Not Performing / Alexander Devyaterikov (Be...
 
The Power of Game and Music Collaborations: Reaching and Engaging the Masses ...
The Power of Game and Music Collaborations: Reaching and Engaging the Masses ...The Power of Game and Music Collaborations: Reaching and Engaging the Masses ...
The Power of Game and Music Collaborations: Reaching and Engaging the Masses ...
 
Branded Content: How to overcome players' immunity to advertising / Alex Brod...
Branded Content: How to overcome players' immunity to advertising / Alex Brod...Branded Content: How to overcome players' immunity to advertising / Alex Brod...
Branded Content: How to overcome players' immunity to advertising / Alex Brod...
 
Resurrecting Chasm: The Rift - A Source-less Remastering Journey / Gennadii P...
Resurrecting Chasm: The Rift - A Source-less Remastering Journey / Gennadii P...Resurrecting Chasm: The Rift - A Source-less Remastering Journey / Gennadii P...
Resurrecting Chasm: The Rift - A Source-less Remastering Journey / Gennadii P...
 
How NOT to do showcase events: Behind the scenes of Midnight Show / Andrew Ko...
How NOT to do showcase events: Behind the scenes of Midnight Show / Andrew Ko...How NOT to do showcase events: Behind the scenes of Midnight Show / Andrew Ko...
How NOT to do showcase events: Behind the scenes of Midnight Show / Andrew Ko...
 

Recently uploaded

Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Krijn Poppe
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringSebastiano Panichella
 
call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@vikas rana
 
miladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxmiladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxCarrieButtitta
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...漢銘 謝
 
Anne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxAnne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxnoorehahmad
 
SBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSebastiano Panichella
 
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.KathleenAnnCordero2
 
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC  - NANOTECHNOLOGYPHYSICS PROJECT BY MSC  - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC - NANOTECHNOLOGYpruthirajnayak525
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationNathan Young
 
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Genesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxGenesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxFamilyWorshipCenterD
 
Genshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxGenshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxJohnree4
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSebastiano Panichella
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power
 
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...marjmae69
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸mathanramanathan2005
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxaryanv1753
 
James Joyce, Dubliners and Ulysses.ppt !
James Joyce, Dubliners and Ulysses.ppt !James Joyce, Dubliners and Ulysses.ppt !
James Joyce, Dubliners and Ulysses.ppt !risocarla2016
 
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comSaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comsaastr
 

Recently uploaded (20)

Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software Engineering
 
call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@
 
miladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxmiladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptx
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
 
Anne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxAnne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptx
 
SBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation Track
 
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
 
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC  - NANOTECHNOLOGYPHYSICS PROJECT BY MSC  - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism Presentation
 
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
 
Genesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxGenesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptx
 
Genshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxGenshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptx
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
 
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptx
 
James Joyce, Dubliners and Ulysses.ppt !
James Joyce, Dubliners and Ulysses.ppt !James Joyce, Dubliners and Ulysses.ppt !
James Joyce, Dubliners and Ulysses.ppt !
 
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comSaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
 

Unity Internals: Memory and Performance

  • 1. Unity Internals: Memory and Performance Moscow, 16/05/2014 Marco Trivellato – Field Engineer
  • 3. Page Who Am I ? •  Now Field Engineer @ Unity •  Previously, Software Engineer •  Mainly worked on game engines •  Shipped several video games: •  Captain America: Super Soldier •  FIFA ‘07 – FIFA ’10 •  Fight Night: Round 3 6/9/14 3
  • 4. Page Topics •  Memory Overview •  Garbage Collection •  Mesh Internals •  Scripting •  Job System •  How to use the Profiler 6/9/14 4
  • 6. Page Memory Domains •  Native (internal) •  Asset Data: Textures, AudioClips, Meshes •  Game Objects & Components: Transform, etc.. •  Engine Internals: Managers, Rendering, Physics, etc.. •  Managed - Mono •  Script objects (Managed dlls) •  Wrappers for Unity objects: Game objects, assets, components •  Native Dlls •  User’s dlls and external dlls (for example: DirectX) 6/9/14 6
  • 7. Page Native Memory: Internal Allocators •  Default •  GameObject •  Gfx •  Profiler 5.x: We are considering to expose an API for using a native allocator in Dlls 6/9/14 7
  • 8. Page Managed Memory •  Value types (bool, int, float, struct, ...) •  Exist in stack memory. De-allocated when removed from the stack. No Garbage. •  Reference types (classes) •  Exist on the heap and are handled by the mono/.net GC. Removed when no longer being referenced. •  Wrappers for Unity Objects : •  GameObject •  Assets : Texture2D, AudioClip, Mesh, … •  Components : MeshRenderer, Transform, MonoBehaviour 6/9/14 8
  • 9. Page Mono Memory Internals •  Allocates system heap blocks for internal allocator •  Will allocate new heap blocks when needed •  Heap blocks are kept in Mono for later use •  Memory can be given back to the system after a while •  …but it depends on the platform è don’t count on it •  Garbage collector cleans up •  Fragmentation can cause new heap blocks even though memory is not exhausted 6/9/14 9
  • 11. Page Unity Object wrapper •  Some Objects used in scripts have large native backing memory in unity •  Memory not freed until Finalizers have run 6/9/14 11 WWW Decompression buffer Compressed file Decompressed file Managed Native
  • 12. Page Mono Garbage Collection •  GC.Collect •  Runs on the main thread when •  Mono exhausts the heap space •  Or user calls System.GC.Collect() •  Finalizers •  Run on a separate thread •  Controlled by mono •  Can have several seconds delay •  Unity native memory •  Dispose() cleans up internal memory •  Eventually called from finalizer •  Manually call Dispose() to cleanup 6/9/14 12 Main thread Finalizer thread www = null; new(someclass); //no more heap -> GC.Collect(); www.Dispose(); .....
  • 13. Page Garbage Collection •  Roots are not collected in a GC.Collect •  Thread stacks •  CPU Registers •  GC Handles (used by Unity to hold onto managed objects) •  Static variables!! •  Collection time scales with managed heap size •  The more you allocate, the slower it gets 6/9/14 13
  • 14. Page GC: does lata layout matter ? struct Stuff { int a; float b; bool c; string leString; } Stuff[] arrayOfStuff; << Everything is scanned. GC takes more time VS int[] As; float[] Bs; bool[] Cs; string[] leStrings; << Only this is scanned. GC takes less time. 6/9/14 14
  • 15. Page GC: Best Practices •  Reuse objects è Use object pools •  Prefer stack-based allocations è Use struct instead of class •  System.GC.Collect can be used to trigger collection •  Calling it 6 times returns the unused memory to the OS •  Manually call Dispose to cleanup immediately 6/9/14 15
  • 16. Page Avoid temp allocations •  Don’t use FindObjects or LINQ •  Use StringBuilder for string concatenation •  Reuse large temporary work buffers •  ToString() •  .tag è use CompareTag() instead 6/9/14 16
  • 17. Page Unity API Temporary Allocations Some Examples: •  GetComponents<T> •  Vector3[] Mesh.vertices •  Camera[] Camera.allCameras •  foreach •  does not allocate by definition •  However, there can be a small allocation, depending on the implementation of .GetEnumerator() 5.x: We are working on new non-allocating versions 6/9/14 17
  • 18. Page Memory fragmentation •  Memory fragmentation is hard to account for •  Fully unload dynamically allocated content •  Switch to a blank scene before proceeding to next level •  This scene could have a hook where you may pause the game long enough to sample if there is anything significant in memory •  Ensure you clear out variables so GC.Collect will remove as much as possible •  Avoid allocations where possible •  Reuse objects where possible within a scene play •  Clear them out for map load to clean the memory 6/9/14 18
  • 19. Page Unloading Unused Assets •  Resources.UnloadUnusedAssets will trigger asset garbage collection •  It looks for all unreferenced assets and unloads them •  It’s an async operation •  It’s called internally after loading a level •  Resources.UnloadAsset is preferable •  you need to know exactly what you need to Unload •  Unity does not have to scan everything •  Unity 5.0: Multi-threaded asset garbage collection 6/9/14 19
  • 21. Page Mesh Read/Write Option •  It allows you to modify the mesh at run-time •  If enabled, a system-copy of the Mesh will remain in memory •  It is enabled by default •  In some cases, disabling this option will not reduce the memory usage •  Skinned meshes •  iOS Unity 5.0: disable by default – under consideration 6/9/14 21
  • 22. Page Non-Uniform scaled Meshes We need to correctly transform vertex normals •  Unity 4.x: •  transform the mesh on the CPU •  create an extra copy of the data •  Unity 5.0 •  Scaled on GPU •  Extra memory no longer needed 6/9/14 22
  • 23. Page Static Batching What is it ? •  It’s an optimization that reduces number of draw calls and state changes How do I enable it ? •  In the player settings + Tag the object as static 6/9/14 23
  • 24. Page Static Batching How does it work internally ? •  Build-time: Vertices are transformed to world- space •  Run-time: Index buffer is created with indices of visible objects Unity 5.0: •  Re-implemented static batching without copying of index buffers 6/9/14 24
  • 25. Page Dynamic Batching What is it ? •  Similar to Static Batching but it batches non-static objects at run-time How do I enable it ? •  In the player settings •  no need to tag. it auto-magically works… 6/9/14 25
  • 26. Page Dynamic Batching How does it work internally ? •  objects are transformed to world space on the CPU •  Temporary VB & IB are created •  Rendered in one draw call Unity 5.x: we are considering to expose per-platform parameters 6/9/14 26
  • 27. Page Mesh Skinning Different Implementations depending on platform: •  x86: SSE •  iOS/Android/WP8: Neon optimizations •  D3D11/XBoxOne/GLES3.0: GPU •  XBox360, WiiU: GPU (memexport) •  PS3: SPU •  WiiU: GPU w/ stream out Unity 5.0: Skinned meshes use less memory by sharing index buffers between instances 6/9/14 27
  • 29. Page Unity 5.0: Mono •  No upgrade •  Mainly bug fixes •  New tech in WebGL: IL2CPP •  http://blogs.unity3d.com/2014/04/29/on-the-future-of- web-publishing-in-unity/ •  Stay tuned: there will be a blog post about it 6/9/14 29
  • 30. Page GetComponent<T> It asks the GameObject, for a component of the specified type: •  The GO contains a list of Components •  Each Component type is compared to T •  The first Component of type T (or that derives from T), will be returned to the caller •  Not too much overhead but it still needs to call into native code 6/9/14 30
  • 31. Page Unity 5.0: Property Accessors •  Most accessors will be removed in Unity 5.0 •  The objective is to reduce dependencies, therefore improve modularization •  Transform will remain •  Existing scripts will be converted. Example: in 5.0: 6/9/14 31
  • 32. Page Transform Component •  this.transform is the same as GetComponent<Transform>() •  transform.position/rotation needs to: •  find Transform component •  Traverse hierarchy to calculate absolute position •  Apply translation/rotation •  transform internally stores the position relative to the parent •  transform.localPosition = new Vector(…) è simple assignment •  transform.position = new Vector(…) è costs the same if no father, otherwise it will need to traverse the hierarchy up to transform the abs position into local •  finally, other components (collider, rigid body, light, camera, etc..) will be notified via messages 6/9/14 32
  • 33. Page Instantiate API: •  Object Instantiate(Object, Vector3, Quaternion); •  Object Instantiate(Object); Implementation: •  Clone GameObject Hierarchy and Components •  Copy Properties •  Awake •  Apply new Transform (if provided) 6/9/14 33
  • 34. Page Instantiate cont..ed •  Awake can be expensive •  AwakeFromLoad (main thread) •  clear states •  internal state caching •  pre-compute Unity 5.0: •  Allocations have been reduced •  Some inner loops for copying the data have been optimized 6/9/14 34
  • 35. Page JIT Compilation What is it ? •  The process in which machine code is generated from CIL code during the application's run-time Pros: •  It generates optimized code for the current platform Cons: •  Each time a method is called for the first time, the application will suffer a certain performance penalty because of the compilation 6/9/14 35
  • 36. Page JIT compilation spikes What about pre-JITting ? •  RuntimeHelpers.PrepareMethod does not work: …better to use MethodHandle.GetFunctionPointer() 6/9/14 36
  • 38. Page Unity 5.0: Job System (internal) The goals of the job system: •  make it easy to write very efficient job based multithreaded code •  The jobs should be able to run safely in parallel to script code 6/9/14 38
  • 39. Page Job System: Why ? Modern architectures are multi-core: •  XBox 360: 3 cores •  PS4/Xbox One: 8 cores …which includes mobile devices: •  iPhone 4S: 2 cores •  Galaxy S3: 4 cores 6/9/14 39
  • 40. Page Job System: What is it ? •  It’s a Framework that we are going to use in existing and new sub-systems •  We want to have Animation, NavMesh, Occlusion, Rendering, etc… run as much as possible in parallel •  This will ultimately lead to better performance 6/9/14 40
  • 41. Page Unity 5.0: Profiler Timeline View It’s a tool that allows you to analyse internal (native) threads execution of a specific frame 6/9/14 41
  • 42. Page Unity 5.0: Frame Debugger 6/9/14 42
  • 44. Page Budgeting Memory How much memory is available ? •  It depends… •  For example, on 512mb devices running iOS 6.0: ~250mb. A bit less with iOS 7.0 What’s the baseline ? •  Create an empty scene and measure memory •  Don’t forget that the profiler requires some memory •  For example: on Android 15.5mb (+ 12mb profiler) 6/9/14 44
  • 45. Page Profiling •  Don’t make assumptions •  Profile on target device •  Editor != Player •  Platform X != Platform Y •  Managed Memory is not returned to Native Land! For best results…: •  Profile early and regularly 6/9/14 45