SlideShare une entreprise Scribd logo
1  sur  203
Squeezing Every Drop Of
Performance Out Of The
         iPhone
             Noel Llopis
            Snappy Touch

    http://twitter.com/snappytouch
       noel@snappytouch.com
     http://gamesfromwithin.com
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!
• 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
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
!=
!=
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

Contenu connexe

Dernier

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 

Dernier (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Squeezing Every Drop Of Performance Out Of The iPhone

Notes de l'éditeur

  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.