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 : EnďŹn 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 ďŹn & tombolaMot de la ďŹn & tombolaMot de la ďŹn & tombolaMot de la ďŹn & tombola
Programme de la ConfĂŠrence
www.soft-shake.ch
4. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Optimizing is...
⢠Risky:âIf it ainât broke, donât ďŹx 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. Š 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. Š 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. Š 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
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. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Instruments
⢠ProďŹling tool
⢠CPU
⢠Memory
⢠CoreAnimation
⢠CoreData
⢠OpenGL
⢠Power
⢠etc.
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. Š 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
15. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Time
⢠Faster code
⢠makes applications more responsive
⢠uses less power
16. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Time
⢠Animation
⢠Objective C
⢠C and ARM code generation
⢠Frameworks
⢠File system
20. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
⢠Demo
Objective C
21. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
C and ARM
Code Generation
⢠Demo
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. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Frameworks
⢠Foundation
⢠Accelerate
⢠Grand Central Dispatch
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. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Accelerate
⢠ARM v6
⢠Integer unit with 16 registers
⢠Hardware ďŹoating-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 ďŹoating-point uses NEON
⢠NEON can decode MP3 on 10MHz CPU
26. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Accelerate
⢠Makes usingVFP and NEON easy
⢠Demo
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. Š 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. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
⢠Demo
Grand Central Dispatch
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 ďŹles use memory mapped ďŹles
+[NSData dataWithContentsOfMappedFile:]
⢠Long I/O off the main thread
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. Š 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. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
NSArchiver
⢠Not an incremental ďŹle format
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. Š 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 preďŹx searching
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. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
2. No Crash
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
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
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. Š 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. Š 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. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
3. Energy
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. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Radios and sensors
⢠Network
⢠CoreLocation
⢠CoreMotion
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. Š 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. Š 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. Š 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
55. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
CoreLocation
⢠distanceFilter
⢠how often you receive location changed
notiďŹcations
⢠default: all changes, many events, high CPU usage
⢠stopUpdatingLocation
⢠when good enough accuracy, switch GPS off.
56. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
CoreMotion
⢠Same thing
⢠Turn sensors off when in background (4.x)
57. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Energy diagnostics
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. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Measure on the go
⢠Enable device
to collect data
⢠Import in
Instruments
60. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Summary
61. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
Instrumentsâ instruments
CPU
Memory
File System
Core Data
Graphics
Energy
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. Š Copyright 2010, Sente SA.All rights reserved. http://www.sente.ch
When?
⢠All the time
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://stackoverďŹow.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