Slide 1

Slide 1 text

These are confidential sessions—please refrain from streaming, blogging, or taking pictures Profiling your App Session 409 Learning Instruments David M. O’Rourke Performance Tools Engineering Manager

Slide 2

Slide 2 text

What You’ll Learn Today

Slide 3

Slide 3 text

What You’ll Learn Today •Elements of performance

Slide 4

Slide 4 text

What You’ll Learn Today •Elements of performance •Methodology to improve performance

Slide 5

Slide 5 text

What You’ll Learn Today •Elements of performance •Methodology to improve performance •Instruments tour

Slide 6

Slide 6 text

What You’ll Learn Today •Elements of performance •Methodology to improve performance •Instruments tour •iOS App optimization demonstrations

Slide 7

Slide 7 text

What Is Performance?

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

"Crashes all the time" "Crashes all the time"

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Performance Is a Feature of Your App

Slide 19

Slide 19 text

Performance Is a Feature of Your App •Xcode to author/build your app

Slide 20

Slide 20 text

Performance Is a Feature of Your App •Xcode to author/build your app •Interface Builder to design your app

Slide 21

Slide 21 text

Performance Is a Feature of Your App •Xcode to author/build your app •Interface Builder to design your app •Instruments to profile your app ■ Optimize performance ■ Reduces crashes and terminations ■ Can improve power usage

Slide 22

Slide 22 text

Performance Profile Process

Slide 23

Slide 23 text

Debug Process

Slide 24

Slide 24 text

Debug Process Reproduce the problem

Slide 25

Slide 25 text

Debug Process Reproduce the problem Debug and inspect logs

Slide 26

Slide 26 text

Debug Process Reproduce the problem Form a hypothesis Debug and inspect logs

Slide 27

Slide 27 text

Debug Process Reproduce the problem Form a hypothesis Make a change Debug and inspect logs

Slide 28

Slide 28 text

Debug Process Reproduce the problem Form a hypothesis Make a change Debug and inspect logs

Slide 29

Slide 29 text

Profile Process

Slide 30

Slide 30 text

Profile Process Reproduce the problem

Slide 31

Slide 31 text

Profile Process Reproduce the problem Profile with tools

Slide 32

Slide 32 text

Profile Process Form a hypothesis Reproduce the problem Profile with tools

Slide 33

Slide 33 text

Profile Process Form a hypothesis Make a change Reproduce the problem Profile with tools

Slide 34

Slide 34 text

Profile Process Form a hypothesis Make a change Reproduce the problem Profile with tools

Slide 35

Slide 35 text

Where Can I Find Instruments?

Slide 36

Slide 36 text

Where Can I Find Instruments?

Slide 37

Slide 37 text

How Do I Access Instruments?

Slide 38

Slide 38 text

How Do I Access Instruments?

Slide 39

Slide 39 text

How Do I Access Instruments?

Slide 40

Slide 40 text

How Do I Access Instruments? •Pro Tip ■ Right-click and choose Keep in Dock

Slide 41

Slide 41 text

Instruments Tour

Slide 42

Slide 42 text

Document Model and Templates

Slide 43

Slide 43 text

Tour

Slide 44

Slide 44 text

Tour Toolbar

Slide 45

Slide 45 text

Tour Strategies

Slide 46

Slide 46 text

Tour Timeline

Slide 47

Slide 47 text

Tour Details

Slide 48

Slide 48 text

Tour Extended Details

Slide 49

Slide 49 text

Toolbar

Slide 50

Slide 50 text

Toolbar

Slide 51

Slide 51 text

Toolbar

Slide 52

Slide 52 text

Toolbar Target menu

Slide 53

Slide 53 text

Toolbar Target menu

Slide 54

Slide 54 text

Toolbar

Slide 55

Slide 55 text

Toolbar

Slide 56

Slide 56 text

Toolbar

Slide 57

Slide 57 text

Toolbar

Slide 58

Slide 58 text

Toolbar

Slide 59

Slide 59 text

Toolbar

Slide 60

Slide 60 text

Timeline Instrument strategy

Slide 61

Slide 61 text

Timeline Threads strategy

Slide 62

Slide 62 text

Timeline CPU strategy

Slide 63

Slide 63 text

Timeline and Filtering System Trace

Slide 64

Slide 64 text

Detail Pane Call Tree

Slide 65

Slide 65 text

Detail Pane Call Tree

Slide 66

Slide 66 text

Detail Pane Sample List

Slide 67

Slide 67 text

Detail Pane Source code

Slide 68

Slide 68 text

Detail Pane Source code

Slide 69

Slide 69 text

Detail Pane Disassembly

Slide 70

Slide 70 text

Detail Pane System Calls

Slide 71

Slide 71 text

Detail Pane Activity summary

Slide 72

Slide 72 text

Instruments

Slide 73

Slide 73 text

Demo Time Profiler example Joe Grzywacz Performance Tools Engineering

Slide 74

Slide 74 text

Use Call Tree

Slide 75

Slide 75 text

Use Call Tree

Slide 76

Slide 76 text

Use Thread Strategy

Slide 77

Slide 77 text

Use Thread Strategy

Slide 78

Slide 78 text

Use CPU Strategy

Slide 79

Slide 79 text

Demo Memory profiling example Victor Hernandez Performance Tools Engineering

Slide 80

Slide 80 text

Use Cycles and Roots

Slide 81

Slide 81 text

Use Allocations

Slide 82

Slide 82 text

Use Allocations

Slide 83

Slide 83 text

Closing Thoughts…

Slide 84

Slide 84 text

Profile Process

Slide 85

Slide 85 text

Profile Process Reproduce the problem

Slide 86

Slide 86 text

Profile Process Reproduce the problem Profile with tools

Slide 87

Slide 87 text

Profile Process Form a hypothesis Reproduce the problem Profile with tools

Slide 88

Slide 88 text

Profile Process Form a hypothesis Make a change Reproduce the problem Profile with tools

Slide 89

Slide 89 text

Profile Process Form a hypothesis Make a change Reproduce the problem Profile with tools

Slide 90

Slide 90 text

Instruments Templates Used

Slide 91

Slide 91 text

Instruments Templates Used 3 Improvements 2 Improvements

Slide 92

Slide 92 text

Can Profile Virtually Anything

Slide 93

Slide 93 text

Can Profile Virtually Anything

Slide 94

Slide 94 text

"Fantastic and Fast" "Fantastic and Fast"

Slide 95

Slide 95 text

"Must buy this app" "Must buy this app"

Slide 96

Slide 96 text

No content

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

No content

Slide 99

Slide 99 text

More Information Michael Jurewitz Developer Tools Evangelist [email protected] Instruments Documentation Instruments User Guide (Xcode Documentation) Instruments New Features User Guide Apple Developer Forums http://devforums.apple.com

Slide 100

Slide 100 text

Related Sessions iOS App Performance: Responsiveness Presidio Thursday 11:30AM iOS App Performance: Graphics and Animations Presidio Thursday 3:15PM iOS App Performance: Memory Presidio Thursday 4:30PM

Slide 101

Slide 101 text

Labs Xcode Lab Developer Tools Lab B Ongoing

Slide 102

Slide 102 text

No content

Slide 103

Slide 103 text

No content

Slide 104

Slide 104 text

No content

Slide 105

Slide 105 text

No content