SlideShare a Scribd company logo
1 of 203
Download to read offline
Squeezing Every Drop Of
Performance Out Of The
         iPhone
             Noel Llopis
            Snappy Touch

    http://twitter.com/snappytouch
       noel@snappytouch.com
     http://gamesfromwithin.com
Squeezing Every Drop Of Performance Out Of The iPhone
Squeezing Every Drop Of Performance Out Of The iPhone
Squeezing Every Drop Of Performance Out Of The iPhone
Squeezing Every Drop Of Performance Out Of The iPhone
Squeezing Every Drop Of Performance Out Of The iPhone
Squeezing Every Drop Of Performance Out Of The iPhone
Running at 40 FPS
on first attempt...
Running at 40 FPS
on first attempt...
... on the simulator!
Running at 40 FPS
    on first attempt...
    ... on the simulator!




4 FPS!
Squeezing Every Drop Of Performance Out Of The iPhone
• Performance analysis tools
• Performance analysis tools
• CPU
• Performance analysis tools
• CPU
• Game loop architecture
• Performance analysis tools
• CPU
• Game loop architecture
• Rendering
• Performance analysis tools
• CPU
• Game loop architecture
• Rendering
• Memory
Performance Analysis
       Tools
Exploratory
Exploratory

• Turning features on and off in real time
Exploratory

• Turning features on and off in real time
• Works very well to get very rough
  estimates
Exploratory

• Turning features on and off in real time
• Works very well to get very rough
  estimates
• Simulation vs. geometry creation vs.
  rendering
Instruments
Instruments
Instruments
Instruments
Instruments

• Versatile
Instruments

• Versatile
• Can display frame rate, object allocations,
  memory usage, or even OpenGL calls.
Instruments

• Versatile
• Can display frame rate, object allocations,
  memory usage, or even OpenGL calls.
• Rut it on the real device, not the simulator!
Instruments
Instruments
Instruments


• TODO: Screenshot digging deeper
Instruments
Instruments


• TODO: Screenshot with memory leaks
Instruments
Instruments

• First pass with Instruments confirmed that
  Flower Garden was simulation bound.
Instruments

• First pass with Instruments confirmed that
  Flower Garden was simulation bound.
• Especially the matrix multiplies and
  geometry creation sections.
Shark
Shark

• CPU usage
Shark

• CPU usage
• More in depth than Instruments
Shark

• CPU usage
• More in depth than Instruments
• Can even report good info on cache misses
Shark
CPU
CPU
CPU

• 32-bit RISC ARM 11
CPU

• 32-bit RISC ARM 11
• 400-535Mhz
CPU

• 32-bit RISC ARM 11
• 400-535Mhz
• iPhone 2G/3G and iPod
  Touch 1st and 2nd gen
CPU (iPhone 3GS)
CPU (iPhone 3GS)


• Cortex-A8 600MHz
CPU (iPhone 3GS)


• Cortex-A8 600MHz
• More advanced
  architecture
Thumb Mode
Thumb Mode
Thumb Mode
    •   CPU has a special thumb
        mode.
Thumb Mode
    •   CPU has a special thumb
        mode.

    •   Less memory, maybe better
        performance.
Thumb Mode
    •   CPU has a special thumb
        mode.

    •   Less memory, maybe better
        performance.

    •   No floating point support.
Thumb Mode
    •   CPU has a special thumb
        mode.

    •   Less memory, maybe better
        performance.

    •   No floating point support.

    •   It’s on by default!
Thumb Mode
    •   CPU has a special thumb
        mode.

    •   Less memory, maybe better
        performance.

    •   No floating point support.

    •   It’s on by default!

    •   Potentially HUGE wins turning
        it off.
Thumb Mode
    •   CPU has a special thumb
        mode.

    •   Less memory, maybe better
        performance.

    •   No floating point support.

    •   It’s on by default!

    •   Potentially HUGE wins turning
        it off.
Thumb Mode
Thumb Mode

• Turning off Thumb mode increased
  performance in Flower Garden by over 2x
Thumb Mode

• Turning off Thumb mode increased
  performance in Flower Garden by over 2x
• Heavy usage of floating point operations
  though
Thumb Mode

• Turning off Thumb mode increased
  performance in Flower Garden by over 2x
• Heavy usage of floating point operations
  though
• Most games will probably benefit from
  turning it off (especially 3D games)
Integer Divide
Integer Divide




There is no integer divide
Vector FP Unit
Vector FP Unit
•   The main CPU has no
    floating point support.
Vector FP Unit
•   The main CPU has no
    floating point support.

•   Compiled C/C++/ObjC
    code uses the vector
    floating point unit for any
    floating point operations.
Vector FP Unit
•   The main CPU has no
    floating point support.

•   Compiled C/C++/ObjC
    code uses the vector
    floating point unit for any
    floating point operations.

•   Can program the VFP in
    assembly for max
    performance.
Vector FP Unit
Vector FP Unit

• Big win when many floating point
  operations can be vectorized.
Vector FP Unit

• Big win when many floating point
  operations can be vectorized.
• Matrix multiplies, skinning, etc
Vector FP Unit

• Big win when many floating point
  operations can be vectorized.
• Matrix multiplies, skinning, etc
• vfpmath project in Google Code
Vector FP Unit
void Matrix4Mul(const float* src_mat_1, const float* src_mat_2,
float* dst_mat)
{
  asm volatile (VFP_SWITCH_TO_ARM
                VFP_VECTOR_LENGTH(3)

                "fldmias %2, {s8-s23}    nt"
                "fldmias %1!, {s0-s3}    nt"
                "fmuls s24, s8, s0       nt"
                "fmacs s24, s12, s1      nt"
//...
Game Loop
Architecture
Game loop
Game loop

  Gather input
Game loop

  Gather input



  Update state
Game loop

  Gather input



  Update state



  Render frame
Game loop

  Gather input




                 Repeat 60 times per
                       second
  Update state



  Render frame
NSTimer
NSTimer
• Easiest way to drive the main loop
NSTimer
• Easiest way to drive the main loop
• All the samples from Apple
NSTimer
• Easiest way to drive the main loop
• All the samples from Apple
m_gameLoopTimer = [NSTimer
     scheduledTimerWithTimeInterval:animationInterval
     target:self
	 	 selector:@selector(doFrame)
     userInfo:nil
     repeats:YES];
NSTimer
NSTimer


• Not very accurate.
  Frames can vary by as
  much as 5-10 ms!
NSTimer


• Not very accurate.
  Frames can vary by as
  much as 5-10 ms!


                           Event
NSTimer


• Not very accurate.
  Frames can vary by as
  much as 5-10 ms!
                           Event
                           Event
NSTimer


• Not very accurate.
  Frames can vary by as
  much as 5-10 ms!        NSTimer
                           Event
                           Event
NSTimer


• Not very accurate.       Event
  Frames can vary by as
  much as 5-10 ms!        NSTimer
                           Event
                           Event
NSTimer


                          NSTimer
• Not very accurate.       Event
  Frames can vary by as
  much as 5-10 ms!        NSTimer
                           Event
                           Event
NSTimer

                           Event
                          NSTimer
• Not very accurate.       Event
  Frames can vary by as
  much as 5-10 ms!        NSTimer
                           Event
                           Event
NSTimer
NSTimer

• Call it at a higher
  frequency so main loop
  is called right away.
NSTimer

• Call it at a higher
  frequency so main loop
  is called right away.




                             Event
NSTimer

• Call it at a higher
  frequency so main loop
  is called right away.


                           NSTimer
                             Event
NSTimer

• Call it at a higher
  frequency so main loop
  is called right away.

                           NSTimer
                           NSTimer
                             Event
NSTimer

• Call it at a higher
  frequency so main loop
  is called right away.    NSTimer
                           NSTimer
                           NSTimer
                             Event
NSTimer

• Call it at a higher
  frequency so main loop   NSTimer
  is called right away.    NSTimer
                           NSTimer
                           NSTimer
                             Event
NSTimer

• Call it at a higher        Event
  frequency so main loop   NSTimer
  is called right away.    NSTimer
                           NSTimer
                           NSTimer
                             Event
NSTimer

• Call it at a higher         Event
    frequency so main loop   NSTimer
    is called right away.    NSTimer

•   Unfortunately that       NSTimer
    floods the message        NSTimer
    queue and causes delay
                              Event
    on touch events
Threads
Threads


• Put the game on a separate thread from
  the UI one.
Threads


• Put the game on a separate thread from
  the UI one.
• Runs as fast as possible without delays
Threads
Threads

• Careful what you do when parsing input
  events from main thread
Threads

• Careful what you do when parsing input
  events from main thread
• Can be more complex to debug
Threads

• Careful what you do when parsing input
  events from main thread
• Can be more complex to debug
• Running as fast as possible might not always
  be desirable (draining battery life)
Threads
Threads
• Can also split game update and rendering in
  two different threads.
Threads
• Can also split game update and rendering in
  two different threads.
• Syncing the two is much more difficult
Threads
• Can also split game update and rendering in
  two different threads.
• Syncing the two is much more difficult
• Can only use one thread for each OpenGL
  context
Threads
• Can also split game update and rendering in
  two different threads.
• Syncing the two is much more difficult
• Can only use one thread for each OpenGL
  context
• Theoretically best results, but maybe not
  much difference
Thread Driving Loop
Thread Driving Loop
m_mainLoop = [[NSThread alloc] initWithTarget:self
              selector:@selector(mainLoopTimer) object:nil];
[m_mainLoop start];
Thread Driving Loop
m_mainLoop = [[NSThread alloc] initWithTarget:self
              selector:@selector(mainLoopTimer) object:nil];
[m_mainLoop start];



-   (void)mainLoopTimer
{
	 while (![[NSThread currentThread] isCancelled])
	 {
	 	 [self performSelectorOnMainThread:@selector(doFrame)
             withObject:nil waitUntilDone:YES];
	 	 usleep(2000);
	}
}
Thread driving loop
Thread driving loop

• Can be best of both worlds
Thread driving loop

• Can be best of both worlds
• Consistent call to main loop
Thread driving loop

• Can be best of both worlds
• Consistent call to main loop
• No flooding of events (cuts in line)
CADisplayLink
CADisplayLink
• Triggered by display refresh
CADisplayLink
• Triggered by display refresh
• Can choose to get a call every X updates
CADisplayLink
• Triggered by display refresh
• Can choose to get a call every X updates
• Consistent update
CADisplayLink
• Triggered by display refresh
• Can choose to get a call every X updates
• Consistent update
• Perfect for games
CADisplayLink
         • Triggered by display refresh
         • Can choose to get a call every X updates
         • Consistent update
         • Perfect for games
m_displayLink  = [CADisplayLink displayLinkWithTarget: selfselector:@selector(mainLoop:)];
m_displayLink.frameInterval = 2;
[m_displayLink addToRunLoop :[NSRunLoopcurrentRunLoop] forMode:NSDefaultRunLoopMode];
CADisplayLink
CADisplayLink


• Only available on SDK 3.1
CADisplayLink


• Only available on SDK 3.1
• Definitely the way to go for future games
Rendering
Squeezing Every Drop Of Performance Out Of The iPhone
iPhone 2G
    iPhone 3G
iPod Touch 1st, 2nd,
 and some 3rd gen
iPhone 2G
                            iPhone 3G
                        iPod Touch 1st, 2nd,
                         and some 3rd gen




     iPhone 3GS
High-end 3rd gen iPod
        Touch
Game loop
Game loop
Game loop
Game loop
Game loop
Game loop
Game loop


• Avoid locking some resource while the
  GPU is rendering.
Game loop


• Avoid locking some resource while the
  GPU is rendering.
• Might get a small speed up by first
  presenting the frame, then updating game
  state, and finally rendering.
Game loop


• Avoid locking some resource while the
  GPU is rendering.
• Might get a small speed up by first
  presenting the frame, then updating game
  state, and finally rendering.
• Almost no difference in Flower Garden
Rendering
Rendering

• A lot of the usual advice for GPUs:
Rendering

• A lot of the usual advice for GPUs:
• Minimize draw primitive calls
Rendering

• A lot of the usual advice for GPUs:
• Minimize draw primitive calls
• Minimize state changes
Rendering

• A lot of the usual advice for GPUs:
• Minimize draw primitive calls
• Minimize state changes
• ...
Vertices
Vertices

• Rendering vertices can become a
  bottleneck
Vertices

• Rendering vertices can become a
  bottleneck
• No true Vertex Buffer Objects on the
  MBX, so CPU involved in every draw call
Vertices

• Rendering vertices can become a
  bottleneck
• No true Vertex Buffer Objects on the
  MBX, so CPU involved in every draw call
• Fixed on the 3GS though
Vertices
Vertices
• Make vertices as small as possible
Vertices
• Make vertices as small as possible
 struct PetalVertex
 {
 #ifdef PETAL_SMALL_VERTEX
 	 int16_t x, y, z;
 	 int16_t u, v;
 	 int16_t u1, v1;
 #else
 	 float x, y, z;
 	 float u, v;
 	 float u1, v1;
 #endif
 };
Vertices
• Make vertices as small as possible
 struct PetalVertex
 {
 #ifdef PETAL_SMALL_VERTEX
 	 int16_t x, y, z;
 	 int16_t u, v;
 	 int16_t u1, v1;
 #else
 	 float x, y, z;
 	 float u, v;
 	 float u1, v1;
 #endif
 };
Vertices
Vertices

• Align vertices on at least 4-byte boundaries
Vertices

• Align vertices on at least 4-byte boundaries
• Experiment with larger alignments
Vertices
Vertices


• Use indexed lists...
Vertices


• Use indexed lists...
• ... ordered as if they were strips.
Mixing OpenGL and
       UIKit
Mixing OpenGL and
             UIKit
• You can mix and match OpenGL
  and UIKit
Mixing OpenGL and
              UIKit
• You can mix and match OpenGL
  and UIKit
• But you have to be very careful
Mixing OpenGL and
             UIKit
• You can mix and match OpenGL
  and UIKit
• But you have to be very careful
• Minimize UIKit elements on top of
  EAGLView
Mixing OpenGL and
             UIKit
• You can mix and match OpenGL
  and UIKit
• But you have to be very careful
• Minimize UIKit elements on top of
  EAGLView
• Keep them opaque
Mixing OpenGL and
             UIKit
• You can mix and match OpenGL
  and UIKit
• But you have to be very careful
• Minimize UIKit elements on top of
  EAGLView
• Keep them opaque
• OK to have smaller EAGLView
Use iPhone Features
Use iPhone Features
Use iPhone Features
Memory
Squeezing Every Drop Of Performance Out Of The iPhone
Squeezing Every Drop Of Performance Out Of The iPhone
!=
!=
Memory rant
Memory rant
• No memory guarantees
Memory rant
• No memory guarantees
• No idea of how much memory will be
  available
Memory rant
• No memory guarantees
• No idea of how much memory will be
  available
• Not even how much memory at startup!
Memory rant
• No memory guarantees
• No idea of how much memory will be
  available
• Not even how much memory at startup!
• Sometimes I’ve seen the game start with as
  low as 3MB free memory!!!
Memory
Memory

• System notifies apps when memory is
  running low
Memory

• System notifies apps when memory is
  running low
• Apps are supposed to free as much
  memory as they can
Memory

• System notifies apps when memory is
  running low
• Apps are supposed to free as much
  memory as they can
• Horrible situation for games!
Memory
Memory
Memory
Memory




WARNING!!
Memory




WARNING!!
Memory
Memory




WARNING!!
Memory




Wait...

          WARNING!!
Memory




     Wait...
... wait for it ...
                      WARNING!!
Memory




     Wait...
... wait for it ...
                      WARNING!!
Memory




WARNING!!
Memory




WARNING!!
Memory




WARNING!!
Memory trick
Memory trick
• Do you prefer to allocate your memory all
  at once at initialization time?
Memory trick
• Do you prefer to allocate your memory all
  at once at initialization time?
• Allocate memory slowly.
Memory trick
• Do you prefer to allocate your memory all
  at once at initialization time?
• Allocate memory slowly.
• When you get a warning, wait a little.
Memory trick
• Do you prefer to allocate your memory all
  at once at initialization time?
• Allocate memory slowly.
• When you get a warning, wait a little.
• If free memory doesn’t increase, release
  some.
Memory trick
• Do you prefer to allocate your memory all
  at once at initialization time?
• Allocate memory slowly.
• When you get a warning, wait a little.
• If free memory doesn’t increase, release
  some.
• Repeat until enough memory
Memory trick
• Do you prefer to allocate your memory all
  at once at initialization time?
• Allocate memory slowly.
• When you get a warning, wait a little.
• If free memory doesn’t increase, release
  some.
• Repeat until enough memory
Thank you!


     Twitter: @snappytouch
 Email: noel@snappytouch.com
Blog: http://gamesfromwithin.com

More Related Content

Recently uploaded

RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIUdaiappa Ramachandran
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
20200723_insight_release_plan
20200723_insight_release_plan20200723_insight_release_plan
20200723_insight_release_planJamie (Taka) Wang
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxYounusS2
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServicePicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServiceRenan Moreira de Oliveira
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Things you didn't know you can use in your Salesforce
Things you didn't know you can use in your SalesforceThings you didn't know you can use in your Salesforce
Things you didn't know you can use in your SalesforceMartin Humpolec
 

Recently uploaded (20)

RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AI
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
20200723_insight_release_plan
20200723_insight_release_plan20200723_insight_release_plan
20200723_insight_release_plan
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptx
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServicePicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Things you didn't know you can use in your Salesforce
Things you didn't know you can use in your SalesforceThings you didn't know you can use in your Salesforce
Things you didn't know you can use in your Salesforce
 

Squeezing Every Drop Of Performance Out Of The iPhone

Editor's Notes

  1. In the last 11 years I’ve made games for almost every major platform out there
  2. In the last 11 years I’ve made games for almost every major platform out there
  3. In the last 11 years I’ve made games for almost every major platform out there
  4. In the last 11 years I’ve made games for almost every major platform out there
  5. In the last 11 years I’ve made games for almost every major platform out there
  6. In the last 11 years I’ve made games for almost every major platform out there
  7. During that time, working on engine technology and trying to achieve maximum performance Performance always very important
  8. Almost a year ago I started Snappy Touch
  9. Almost a year ago I started Snappy Touch
  10. Almost a year ago I started Snappy Touch
  11. When you’re on the engine team of a AAA game, you can spend a lot of time on performance. On the iPhone, I didn’t think I had the time In a few days I had the prototype ported over with one small problem
  12. When you’re on the engine team of a AAA game, you can spend a lot of time on performance. On the iPhone, I didn’t think I had the time In a few days I had the prototype ported over with one small problem
  13. When you’re on the engine team of a AAA game, you can spend a lot of time on performance. On the iPhone, I didn’t think I had the time In a few days I had the prototype ported over with one small problem
  14. When you’re on the engine team of a AAA game, you can spend a lot of time on performance. On the iPhone, I didn’t think I had the time In a few days I had the prototype ported over with one small problem
  15. Lessons learned getting frame rate from 4 fps to ~30 fps
  16. Lessons learned getting frame rate from 4 fps to ~30 fps
  17. Lessons learned getting frame rate from 4 fps to ~30 fps
  18. Lessons learned getting frame rate from 4 fps to ~30 fps
  19. Lessons learned getting frame rate from 4 fps to ~30 fps
  20. Best way to start. Frame rate over time plus CPU sampler
  21. Digging deeper
  22. Also good for tracking memory leaks (wish for more automated way though)
  23. This is where the biggest bottlenecks were for Flower Garden at first
  24. This is where the biggest bottlenecks were for Flower Garden at first
  25. This is where the biggest bottlenecks were for Flower Garden at first
  26. Still single core
  27. Still single core
  28. So plan accordingly!
  29. So plan accordingly!
  30. Main difference between games and apps is the constant amount of “stuff” happening on screen. Event-driven architecture is not a very good match for games
  31. Main difference between games and apps is the constant amount of “stuff” happening on screen. Event-driven architecture is not a very good match for games
  32. Main difference between games and apps is the constant amount of “stuff” happening on screen. Event-driven architecture is not a very good match for games
  33. Main difference between games and apps is the constant amount of “stuff” happening on screen. Event-driven architecture is not a very good match for games
  34. Main difference between games and apps is the constant amount of “stuff” happening on screen. Event-driven architecture is not a very good match for games
  35. Main difference between games and apps is the constant amount of “stuff” happening on screen. Event-driven architecture is not a very good match for games
  36. Main difference between games and apps is the constant amount of “stuff” happening on screen. Event-driven architecture is not a very good match for games
  37. Main difference between games and apps is the constant amount of “stuff” happening on screen. Event-driven architecture is not a very good match for games
  38. Main difference between games and apps is the constant amount of “stuff” happening on screen. Event-driven architecture is not a very good match for games
  39. Main difference between games and apps is the constant amount of “stuff” happening on screen. Event-driven architecture is not a very good match for games
  40. OK for games that don’t require a high/steady frame rate
  41. OK for games that don’t require a high/steady frame rate
  42. OK for games that don’t require a high/steady frame rate
  43. The app becomes even less responsive
  44. The app becomes even less responsive
  45. The app becomes even less responsive
  46. The app becomes even less responsive
  47. The app becomes even less responsive
  48. The app becomes even less responsive
  49. The app becomes even less responsive
  50. The app becomes even less responsive
  51. That’s what I’m using in Flower Garden
  52. That’s what I’m using in Flower Garden
  53. No multiple cores, but we have a GPU How to parallelize the two?
  54. No multiple cores, but we have a GPU How to parallelize the two?
  55. No multiple cores, but we have a GPU How to parallelize the two?
  56. No multiple cores, but we have a GPU How to parallelize the two?
  57. Need to set correct scaling/biasing matrix on the other end Textures jumped around when made uvs a byte
  58. Need to set correct scaling/biasing matrix on the other end Textures jumped around when made uvs a byte
  59. Need to set correct scaling/biasing matrix on the other end Textures jumped around when made uvs a byte
  60. You get the best performance without the degenerate verts of a strip
  61. You get the best performance without the degenerate verts of a strip
  62. Use multitexturing (2 texture combiners) Point sprites
  63. Use multitexturing (2 texture combiners) Point sprites
  64. This makes it clear that the iPhone is NOT a game console (unfortunately)
  65. This makes it clear that the iPhone is NOT a game console (unfortunately)
  66. This makes it clear that the iPhone is NOT a game console (unfortunately)
  67. Apple wants you to play nice and work with any amount of memory Game developers want to count on the available memory and use it all Clash!
  68. Apple wants you to play nice and work with any amount of memory Game developers want to count on the available memory and use it all Clash!
  69. Apple wants you to play nice and work with any amount of memory Game developers want to count on the available memory and use it all Clash!
  70. Apple wants you to play nice and work with any amount of memory Game developers want to count on the available memory and use it all Clash!
  71. If you wait too long and nobody does anything, process is killed (no warning) It’s a giant game of chicken!
  72. If you wait too long and nobody does anything, process is killed (no warning) It’s a giant game of chicken!
  73. Be extremely careful with that! Potential for crashes in some phones if not enough memory.
  74. Be extremely careful with that! Potential for crashes in some phones if not enough memory.
  75. Be extremely careful with that! Potential for crashes in some phones if not enough memory.
  76. Be extremely careful with that! Potential for crashes in some phones if not enough memory.
  77. Be extremely careful with that! Potential for crashes in some phones if not enough memory.
  78. Be extremely careful with that! Potential for crashes in some phones if not enough memory.