Index

imageA

Android

benchmarking, 244, 245

data caching, 250

emulator, 242243

ListViews performance, 246248

memory management, 259260

multitasking, 261262

multithreading, 255257

programming language, 242

Automatic reference counting (ARC)

coding, 180

qualifiers

autoreleasing, 183

object property, 183

strong reference, 182

unsafe_unretained reference, 183

variable declarations, 183

weak reference, 182

rules, 182

Xcode, 181

imageB

Belady's algorithm, 65

Big-O notation

computation logics, 90, 91

CPU Sampler, 93, 94

general performance analysis, 93

insertion sort performance, 92

myFirstArray and mySecondArray elements, 90

myFirstCount and mySecondCount variables, 90

Time Profiler, 9395

Binary tree, 106

insert/delete mechanism, 121

left and right child, 121

node and edge, 120

O(log(n)) performance, 119

search strategy, 117118

search tree, 121, 123

sorting algorithms, 116

uses, 119

Bottleneck

file activity instrument, 60, 61

file/network loading test, 60

system usage instrument, 61

imageC

C programming

advanced data types

array, 224225

bitwise operators, 229230

function pointers, 228

linked list, 227228

memory management mechanism, 226227

string, 225

struct, 225

benefits and costs, 220

data types and functions, 221222

pointer, 222224

C programming, 262

C++ programming, 231, 262

.h and .cpp files, 238

benefits and costs, 220

class, 231232, 238

inheritance, 233234

memory management, 232

multiple inheritance, 234235

MyObject.h and MyObject.m files, 238

pointers, 232

template, 235236

TestC_CPlus, 238

Caching

Belady's algorithm, 65

cache hit, 62

cache invalidation, 64

cache miss, 62

data caching. See Data caching

definition, 62

FIFO, 6667

image storage

application bundle, 76

cache directory, 73

documents directory, 7475

photo album, 7576

temporary directory, 73

least frequently used algorithm, 7071

least recently used algorithm, 68, 70

measuring cache, 7172

memory caching. See Memory caching

random replacement, 66

replacement policy, 6465

retrieval cost, 63

simple time-based algorithm, 6768

storage cost, 63

UIWebView, 72

Cocoa Touch data structures

hashing, 98

isEqual and Hash methods, 98, 100

NSMutableArray, 95

access, 97

API, 97

array illustration, 96

insert/delete, 96

search, 96

sorting, 97

NSMutableSet

access, 102

API, 102103

hash method, 100, 101

insert/delete, 101

khang, 101

NSMutableDictionary, 104105

search, 101

sorting, 102

Core animation, 2527

image D, E

Data caching

checking and deleting, 81

CoreData storing, 7880

plist/xml/json storing, 7778

SQLite, 8081

Data encapsulation, 83

Data structure and algorithm, 253254

benchmark testing, 88, 89

Big-O notation. See Big-O notation

binary tree, 106, Seealso Binary tree

Cocoa Touch data structures. See Cocoa Touch data structures

graph, 106

breadth-first search algorithm, 128, 130

connected graph, 124

depth-first search algorithm, 125128

directed graph, 125

path, 124

vertex and edge, 124

weighted graph, 125

intersect method, 89

linked list, 106110

Add Object method, 110111

Count method, 112

Get Object method, 112

Init method, 110

ListNode, 107108

Node and List object, 107

performance analysis, 113

Remove Object method, 113

vs. array, 106

NSLog and NSDate, 89

NSSet API, 88, 89

recursion, 131132

SAX/DOM Parser, 132133

source coding, 88

stack and queue, 106, 113116

imageF, G

Facebook, 41

First In First Out (FIFO) algorithm, 6667

imageH

Hashing, 98

imageI, J, K

iOS performance optimization

Android and Windows Phone environment, 2

Cocoa Touch Framework, 2

Java development, 2

Mac OS, Xcode, 3

network data transfers, 2

smartphone, 1

Stack Overflow, 2

iPhone, 242

imageL

Legacy code

memory garbage, 1618

memory leaks

leaks instrument, 1516

static analyzer, 1314

image M, N

Memory caching

Global Access vs. Strict Access, 82

image preloading, 8385

memory allocations and usage, 82

memory warnings, 82

Memory management

advanced autorelease pool, 191192

advanced memory issues, 184185

ARC. See Automatic reference counting (ARC)

autorelease method, 178179

autorelease pool, 179180

instruments

leak instrument, 193

memory warning levels, 195

object allocation, 194195

static analyzer, 193

Zombie, 194

object copy, 188190

old object ownership policy, 178

UIViewController. SeeUIViewController

Multitasking apps performance

application life cycle events, 214

audio service, 206207

background execution technique, 211213

benefits and costs, 204205

guidelines, 213

handler methods, 202204

iOS 3.2, 198

iOS 4.0, 199

iOS versions, 216

life cycle

application:didEnterBackground method, 200, 201

application:didFinishLaunchingWithOptions method, 199

applicationWillTerminate method, 199

background and suspend states, 201

phone interruption and home button, 202

location notification, 211

location service, 207

continuous background location update mechanism, 210

significant location change mechanism, 209210

standard location services, 208209

memory, 213214

shared resources, 214

show splash screen, 207

system changes notification, 215216

user interface update, 214215

VOIP, 211

Multithreading

advantages, 139, 142143, 152

asynchronous functions, 172173

autorelease pool, 153

Core Animation instrument, 140

disadvantages, 152

exception handler, 153

Idle-Time Notifications, 173174

image loading process, 140

instrument, iPhone, 174

liveness

deadlock, 164166

NSCondition solution, 163164

NSLock solution, 162

push and pop threads, 161

multi-processor system, 138

NSObject, 145

NSOperationQueue, 146

code snippet, 147

NSBlockOperation, 148

NSInvocationOperation, 147

NSOperation, 148150

NSThread, 144

NSTimer, 171

odd/even integer code, 156

performance, 166168

POSIX Threads, 144145

priorities, 151

run loop, 154

safety

application crash, 157

lock mechanism, 159161

thread safety code, 157158

single-processor system, 138

stack size, 150151

stacks, 151

synchronization, 169170

terminology, 139140

thread-local storage, 151

UIImageView, 141142

UITableViewDataSource's Method, 141

imageO

Old object ownership policy, 178

OpenGL ES driver, 2728

image P, Q, R

Performance tools, 18

battery power measurement, 3132

blank template, 33

CPU measurement

activity monitor, 23

advantages, 22

CPU sampler panel, 21

disadvantages, 2223

Hide System Libraries, 21

running count, function call, 22

running time, function call, 22

sample and stack trace, 20

system load and user load, 21

usages, 23

file and network access measurement

file activity, 2930

system usage, 2829

file I/O and network access, 19

instrument applications, 1920

instrument tools, 3436

library list, 33

measure thread performance, 30

time measurement, 2324

user interface response time measurement

core animation, 2526

OpenGL ES driver, 2728

imageS

Simulators and real device test

basic tools, 910

iPhone simulator environment and real iPhone environment, 8

memory and runtime performance, 8, 9

memory tools

automatic reference counting, 10

convert tool, 10

legacy code. See Legacy code

memory allocation, 1113

performance tools. See Performance tools

SlowPerformanceTableView project, 41

Smartphone, 1

SQLite, 236238

Stack and queue, 114116

imageT

Thread-safe, 169

imageU

UITableView performance

cell preparation process, 54

CoreAnimation tool, 4041

custom cell drawing

custom drawing code, 51

drawInRect method, 53

drawRect method, 53

images reusing, 51

source code, 52

TableViewCell, 52

user interface, 50

editing/reordering performance, 56

Facebook, 41

graphical effects, 5556

height caching, 54

images reusing, 4849

initial benchmark, 43

NSLog, 40

opaque, 55

preparation time reduction, 49

ReuseIdentifier, 54

SlowPerformanceTableView project, 41

standard benchmark, 4243

tableView dequeues, 39

UITableViewCell reusing

benchmarks, 47

CPU-intensive process, 43

custom class ReuseTableViewCell, 45

custom code, 46

interface builder, 4445

Nib file, 46

standard TableView Cell, 44

UIViewController

life cycle, 185

load view process, 185186

unload view process, 186187

viewDidAppear method, 188

viewDidDisappear method, 188

viewWillAppear method, 187

viewWillDisappear method, 188

imageV

Voice Over IP (VOIP), 211

imageW, X, Y, Z

Windows phone

automatic binding mechanism, 246

benchmarking, 245

C# programming language, 242

data caching, 251253

emulator, 243

ListViews performance, 248249

memory management, 260261

multithreading, 257258

user interface framework, 242

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset