Marc-Antoine Scheurer
2010
i5
Optimizing iOS applications
Agilité iPhone Java Incubateur
8:15 Accueil des participantsAccueil des participantsAccueil des participantsAccueil des pa...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Optimizing iOS Applications
Marc-Antoine Scheurer
marc...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Optimizing is...
• Risky:“If it ain’t broke, don’t fix ...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Why?
• For the user: better experience
• For you: beat...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
A Hardware Problem:
Limited Resources
3G 3GS 4 iPad
CP...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Where to start?
Measuring Performance
• Guessing often...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Measuring Tools
• NSLog
• Instruments
• Simulator
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
NSLog
NSDate *startTime = [NSDate date];
...
	 	
NSLog...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Instruments
Tool Introduced
Objective C 1988
Interface...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Instruments
• Profiling tool
• CPU
• Memory
• CoreAnima...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Simulator
• Software simulator ≠ hardware emulator
Sim...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Better user experience
1. Responsive application
2. No...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
1. Responsive
applications
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Time
• Faster code
• makes applications more responsiv...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Time
• Animation
• Objective C
• C and ARM code genera...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Animation
• Demo
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Animation
• Scrolling at 60 fps
• Reuse identifier
• Op...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Objective C
• Blocks
• IMP caching
	 [array indexesOfO...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
• Demo
Objective C
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
C and ARM
Code Generation
• Demo
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
C and ARM
Code Generation
• ARM v6 (2G, 3G)
• ARM v7 (...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Frameworks
• Foundation
• Accelerate
• Grand Central D...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Foundation
• NSMutableArray, NSMutableString
• insert ...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Accelerate
• ARM v6
• Integer unit with 16 registers
•...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Accelerate
• Makes usingVFP and NEON easy
• Demo
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Accelerate
• 2000 APIs for hardware accelerated math
•...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Grand Central Dispatch
• Concurrent programming
• Mult...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
• Demo
Grand Central Dispatch
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
File system
• Access to Flash memory is relatively slo...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
File System
• I/O of small amount of data:
• NSUserDef...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Property Lists
• Binary Format 2-3x faster than XML
• ...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
NSArchiver
• Not an incremental file format
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Database
• Use CoreData
• Do not import large
quantity...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Database Search
• Unicode string comparisons are expen...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Database Search
• Point deVue app: 25’000 records
3G B...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
2. No Crash
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Activity Watchdog
Maximum Allowed TimeMaximum Allowed ...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Memory Watchdog
“Jetsam”
• Watches memory pressure
• I...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Memory
• No swap
• (but yes: virtual memory)
• Memory ...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Memory Usage
• Avoid
• spikes
• leaks
• abandoned memo...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Memory Spikes
• Be smart with autorelease
• Process la...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
• Demo
Memory Spikes
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Memory Leaks
• Allocated memory that is inaccessible
•...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Abandoned Memory
• Wasted memory
• Accessible but neve...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Zombies
• Messages send to deallocated object
• Detect...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
3. Energy
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Energy (iPhone 3G)
• 3G,WiFi, Bluetooth, GPS: 2 W
• CP...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Radios and sensors
• Network
• CoreLocation
• CoreMoti...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Network
• Bandwidth usage impacts time and power
• Use...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
3G
• 3G networks require phones stay in high-
power st...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
WiFi & 2G
• Less power than 3G
• 3G > 2G > WiFi
• Allo...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
CPU
• Burst
• Do not poll, use events
• Accelerate: mo...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
CoreLocation
• Use minimum required accuracy
GPS kCLLo...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
CoreLocation
• distanceFilter
• how often you receive ...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
CoreMotion
• Same thing
• Turn sensors off when in bac...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Energy diagnostics
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Energy usage
• Works on
• 3GS
• 4
• iPod 2 & 3
Level B...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Measure on the go
• Enable device
to collect data
• Im...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Summary
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Instruments’ instruments
CPU
Memory
File System
Core D...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Instruments Wireless
• Connect device with USB
• Hold ...
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
When?
• All the time
© Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Useful links
• Xcode Developer documentation
• Apple
h...
Upcoming SlideShare
Loading in …5
×

soft-shake.ch - Optimizing iOS applications

1,933 views
1,823 views

Published on

Marc-Antoine Scheurer

Tips and tricks to get the best performance out of an iOS application.

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,933
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
16
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

soft-shake.ch - Optimizing iOS applications

  1. 1. Marc-Antoine Scheurer 2010 i5 Optimizing iOS applications
  2. 2. Agilité iPhone Java Incubateur 8:15 Accueil des participantsAccueil des participantsAccueil des participantsAccueil des participants 8:40 Mot des organisateurs & Criée des orateursMot des organisateurs & Criée des orateursMot des organisateurs & Criée des orateursMot des organisateurs & Criée des orateurs 9:00 Keynote de Nicolas Martignole (30 minutes)Keynote de Nicolas Martignole (30 minutes)Keynote de Nicolas Martignole (30 minutes)Keynote de Nicolas Martignole (30 minutes) 9:40 10:40 - A1 - Le terrain Agile Jean-Philippe Vigniel - I1- Hello iPhone Stephane Tavera - J1 - NOSQL also means RDF stores: an Android case study Fabrizio Giudci - X1 - Le développement durable Dominic Williams 11:00 12:00 - A2 - Integration of User Centered Design in Agile Development of RIA J. Borkenhagen, J. Desmazières - I2 - Développement d'une application iPhone pilotée par les tests Emmanuel Etasse, Van-Charles Tran - J2 - La Tequila du développement Web Nicolas Martignole - X2 - Cloud Computing: anatomie et pratique Marc-Elian Bégin 12:20 13:20 - A3 - Adoption de l'Agilité par les usages Xavier Warzee - I3 - Distribution d'applications iPhone en Entreprise: Réalisation d'un AppStore interne Géraud de Laval - J3 - Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaScript Joonas Lehtinen - X3 - Les DVCS sont vos amis Sébastien Douche Pause repas (50 minutes)Pause repas (50 minutes)Pause repas (50 minutes)Pause repas (50 minutes) 14h10 Keynote de Regis Medina (30 minutes)Keynote de Regis Medina (30 minutes)Keynote de Regis Medina (30 minutes)Keynote de Regis Medina (30 minutes) 14h50 15h50 - A4 - Scrum, introduction et mise en oeuvre avec iceScrum Claude Aubry - I4 - Agile iOS Development Jérôme Layat, Alexander Osterwalder - J4 - JAX-RS and Java EE 6 Paul Sandoz - X4 - IT Design & Ergonomy Pascal Petit, Aude Lussigny 16h10 17h10 - A5 - Agilité : 10 ans déjà Thierry Cros - I5 - Optimizing iOS applications Marc-Antoine Scheurer - J5 - Ecrivez et automatisez vos tests fonctionnels avec jBehave Xavier Bourguignon - X5 - NoSQL : Enfin de la biodiversité dans l'écosystème des BD Olivier Mallassi 17h30 18h30 - A6 - Lean engineering Jean-Christophe Dubail - I6 - iPhone et Agile, l'amour vache Guillaume Duquesnay - J6 - Let's make this test suite run faster David Gageot - X6 - The feel of Scala Mario Fusco Mot de la fin & tombolaMot de la fin & tombolaMot de la fin & tombolaMot de la fin & tombola Programme de la Conférence www.soft-shake.ch
  3. 3. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Optimizing iOS Applications Marc-Antoine Scheurer marco@sente.ch
  4. 4. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Optimizing is... • Risky:“If it ain’t broke, don’t fix it” • A hardware problem:“Buy a faster computer” • Time consuming:“I don’t have time for performance work” • Complicated:“I don’t know where to start or what to do”
  5. 5. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Why? • For the user: better experience • For you: beat the competition • For the OS: watch out the watchdog
  6. 6. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch A Hardware Problem: Limited Resources 3G 3GS 4 iPad CPU ARM 11 ARM Cortex A8 A4 (Cortex A8) A4 (Cortex A8) clock 412 MHz 600 MHz 1 GHz 1GHz L1 32 KB 64 KB 64 KB 64 KB L2 - 256 KB 640 KB 640 KB GPU triangles / s PowerVR MBX Lite 0.6 M PowerVR SGX 5.2 M A4 (PowerVR SGX) 28 M ?? A4 (PowerVR SGX) 28 M ?? RAM 128 MB 256 MB 512 MB 256 MB available 40 MB 150 MB 400 MB ? 150 MB Flash available 8 - 32 GB 2 GB 16 - 32 GB 2 GB 16 - 32 GB 2 GB 16 - 32 - 64 GB 2 GB Screen 480x320 480x320 960x640 1024x728 More GPS Compass Gyroscope Battery 6h on WiFi 9h on WiFi 10h on WiFi 10-12h video
  7. 7. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Where to start? Measuring Performance • Guessing often does not work • Measure - Change - Measure • Use measuring tools
  8. 8. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Measuring Tools • NSLog • Instruments • Simulator
  9. 9. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch NSLog NSDate *startTime = [NSDate date]; ... NSLog (@"Elapsed time: %.3f", -[startTime timeIntervalSinceNow]);
  10. 10. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Instruments Tool Introduced Objective C 1988 Interface Builder 1988* Xcode 1988† Instruments 2007‡ † Project Builder, renamed Xcode in 2003 ‡ Shikari, Shark in 2002 * SOS Interface, 1984-1986 (LISP, Mac)
  11. 11. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Instruments • Profiling tool • CPU • Memory • CoreAnimation • CoreData • OpenGL • Power • etc.
  12. 12. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Simulator • Software simulator ≠ hardware emulator Simulator 3G i386 ARM 2.5 GHz 400 MHz Unlimited memory 40 MB • Measure and test on oldest supported device (3G) • Simulator OK to check memory usage
  13. 13. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Better user experience 1. Responsive application 2. No crash (or kill by the watchdog) 3. Save battery life
  14. 14. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch 1. Responsive applications
  15. 15. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Time • Faster code • makes applications more responsive • uses less power
  16. 16. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Time • Animation • Objective C • C and ARM code generation • Frameworks • File system
  17. 17. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Animation • Demo
  18. 18. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Animation • Scrolling at 60 fps • Reuse identifier • Opaque views • Reuse formatters • UINib (4.x)
  19. 19. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Objective C • Blocks • IMP caching [array indexesOfObjectsWithOptions:NSEnumerationConcurrent passingTest:^(id obj, NSUInteger idx, BOOL *stop) { return [obj test:value]; } ]
  20. 20. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch • Demo Objective C
  21. 21. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch C and ARM Code Generation • Demo
  22. 22. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch C and ARM Code Generation • ARM v6 (2G, 3G) • ARM v7 (3GS, 4) • -Os vs -O3 • Floating points: remove Thumb on v6 • Contiguous memory, shadow variables, etc.
  23. 23. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Frameworks • Foundation • Accelerate • Grand Central Dispatch
  24. 24. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Foundation • NSMutableArray, NSMutableString • insert O(N), O(1) at begin and end • NSMutableDictionary, NSMutableSet • lookup O(1) with good hash function • NSMutableIndexSet • Store integers without NSNumber
  25. 25. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Accelerate • ARM v6 • Integer unit with 16 registers • Hardware floating-point (VFP) • 32 single precision registers • 16 double precision registers • ARM v7 • Integer unit with 16 registers • LegacyVFP support • NEON: 16 128-bit vector registers • Single precision floating-point uses NEON • NEON can decode MP3 on 10MHz CPU
  26. 26. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Accelerate • Makes usingVFP and NEON easy • Demo
  27. 27. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Accelerate • 2000 APIs for hardware accelerated math • vDSP (Digital Signal Processing) • Fourier transforms • BLAS (Basic Linear Algebra Subprograms) • Matrix product • LAPACK (Linear algebra) • Solving system of linear equations • Later? vImage, vForce, ...
  28. 28. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Grand Central Dispatch • Concurrent programming • Multicore or single core • Easier and lighter than threads • Use to move long processes off the main thread • dispatch_async()
  29. 29. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch • Demo Grand Central Dispatch
  30. 30. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch File system • Access to Flash memory is relatively slow • Speed vary a lot from device to device • For large files use memory mapped files +[NSData dataWithContentsOfMappedFile:] • Long I/O off the main thread
  31. 31. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch File System • I/O of small amount of data: • NSUserDefaults • Property Lists • NSArchiver • I/O of large amount of data: • Incremental formats • Databases (CoreData)
  32. 32. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Property Lists • Binary Format 2-3x faster than XML • Use NSPropertyListSerialization -[NSArray writeToFile:atomically:] -[NSDictionary writeToFile:atomically:] -[NSString writeToFile:atomically:encoding:error:] NSData *data = [NSPropertyListSerialization dataWithPropertyList:dictionary format:NSPropertyListBinaryFormat_v1_0 options:0 error:NULL]; [data writeToFile:path atomically:YES]; • Slow: • Fast:
  33. 33. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch NSArchiver • Not an incremental file format
  34. 34. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Database • Use CoreData • Do not import large quantity of data... • Add object stores instead
  35. 35. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Database Search • Unicode string comparisons are expensive • Use normalized derived attribute (without accents) • Use <= and < instead of BEGINSWITH • Prefer prefix searching
  36. 36. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Database Search • Point deVue app: 25’000 records 3G Before After [[each name] rangeOfString:searchString options:(NSAnchored| NSCaseInsensitive| NSDiacriticInsensitiveSearch)].location != NSNotFound [[each asciiName] hasPrefix:searchString ] “l” 0.704 0.450 “la” 0.032 0.024 “lau” 0.010 0.008 “laus” 0.001 0.001
  37. 37. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch 2. No Crash
  38. 38. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Activity Watchdog Maximum Allowed TimeMaximum Allowed Time Launch 20 s Resume 10 s Suspend 10 s Quit 6 s Operation 10 min
  39. 39. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Memory Watchdog “Jetsam” • Watches memory pressure • Issues low memory warning • Instant termination of application
  40. 40. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Memory • No swap • (but yes: virtual memory) • Memory usage also impacts time • allocation time, • unloading of executable code, ...
  41. 41. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Memory Usage • Avoid • spikes • leaks • abandoned memory • zombies
  42. 42. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Memory Spikes • Be smart with autorelease • Process large quantities of data in batches • Nested autorelease pools
  43. 43. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch • Demo Memory Spikes
  44. 44. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Memory Leaks • Allocated memory that is inaccessible • Unbalanced retain/release • Forget to release property’s original value • Leaks Instrument examines heap for leaked memory, identify allocation • Xcode: Build and Analyze
  45. 45. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Abandoned Memory • Wasted memory • Accessible but never used • Memory should not grow without bounds • Detect with Allocation Instrument:“heap shots”
  46. 46. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Zombies • Messages send to deallocated object • Detect with Zombies template • or Allocations “Enable zombie detection” • Simulator only
  47. 47. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch 3. Energy
  48. 48. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Energy (iPhone 3G) • 3G,WiFi, Bluetooth, GPS: 2 W • CPU + GPU: 800 mW • Screen: 200 mW
  49. 49. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Radios and sensors • Network • CoreLocation • CoreMotion
  50. 50. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Network • Bandwidth usage impacts time and power • Use compact protocols (JSON vs XML)
  51. 51. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch 3G • 3G networks require phones stay in high- power state for a few seconds after last packet is sent or received • Limit number of connections • Do not poll • Use compact data formats
  52. 52. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch WiFi & 2G • Less power than 3G • 3G > 2G > WiFi • Allowed to idle immediately • 2G much slower
  53. 53. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch CPU • Burst • Do not poll, use events • Accelerate: more power, less energy Power Time with NEON without NEON
  54. 54. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch CoreLocation • Use minimum required accuracy GPS kCLLocationAccuracyBest GPS kCLLocationAccuracyNearestTenMeters WiFi kCLLocationAccuracyHundredMeters Cell / WiFi kCLLocationAccuracyKilometer
  55. 55. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch CoreLocation • distanceFilter • how often you receive location changed notifications • default: all changes, many events, high CPU usage • stopUpdatingLocation • when good enough accuracy, switch GPS off.
  56. 56. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch CoreMotion • Same thing • Turn sensors off when in background (4.x)
  57. 57. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Energy diagnostics
  58. 58. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Energy usage • Works on • 3GS • 4 • iPod 2 & 3 Level Battery life 20 Less than 1 hour 10 About 10 hours 1 More than 20 hours
  59. 59. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Measure on the go • Enable device to collect data • Import in Instruments
  60. 60. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Summary
  61. 61. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Instruments’ instruments CPU Memory File System Core Data Graphics Energy
  62. 62. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Instruments Wireless • Connect device with USB • Hold alt while choosing target • Choose wireless device • Disconnect from USB
  63. 63. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch When? • All the time
  64. 64. © Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch Useful links • Xcode Developer documentation • Apple http://developer.apple.com/iphone http://developer.apple.com/videos/wwdc/2010/ • Developer forums http://www.iphonedevsdk.com/ http://stackoverflow.com • Developer classes Stanford iPhone Application Development (english, free) sur iTunesU http://deimos3.apple.com/WebObjects/Core.woa/Browse/itunes.stanford.edu.3124430053.03124430055 Sen:te (french, paying) http://www.iphone-class.com

×