High Performance iOS Apps

所需积分/C币:48 2016-08-10 10:18:33 39.15MB PDF

High performance iOS apps Gauray vaish Beijing.Boston. Farnham Sebastopol. Tokyo OREILLY High Performance iOS Apps by garay vais Copyright o 2016 Gaurav Vaish. All rights reserved Printed in the united states of america Published by O Reilly Media, InC, 1005 Gravenstein Highway North, Sebastopol, CA 95472 OReilly books may be purchased for educational, business, or sales promotional use Online editions are alsoavailableformosttitles(http:/safaribooksonline.com).Formoreinformationcontactourcorporate institutionalsalesdepartment800-998-9938orcorporate@oreilly.com Editor Courtney allen Indexer: Judy mcconville Acquisitions Editor: Brian Anderson Interior Designer: David Futato Production Editor: Nicole Shelby Cover Designer: Karen Montgomery 〔 opyeditor: asmine Ky Illustrator Rebecca dema Proofreader: Rachel head Ine First edition Revision History for the First Edition 2016-06-10 First Release Seehttp://oreilly.com/catalog/errata.csp?isbn=9781491911006forreleasedetails The O Reilly logo is a registered trademark of O Reilly Media, Inc. High Performance iOS Apps, the cover image, and related trade dress are trademarks of O Reilly Media, Inc While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or right 978-1-491-91100-6 ILSII This book is dedicated to agryay vaish, my son Table of contents Preface XIl Part I. Getting Started 1. Performance in Mobile Apps.............. Defining Performance Performance metrics Memory Power Consumption Initialization Time Execution Speed Responsiveness Local storage Interoperability Network condition Bandwidth 334444556789991 Data refresh Multiuser Support Single Sign-on Security Crashes 11 App Profiling 12 Sampling 12 Instrumentation Measurement 12 Project and Code Setup Crash Reporting Setup 14 Instrumenting Your App 15 Logging 20 Summary 23 Part ll. Core Optimizations 2. Memory Management. 27 Memory consumption 28 Stack size 28 Heap size 29 Memory Management Model 32 Autoreleasing Objects 34 Autorelease pool blocks 35 Automatic Reference Counting 39 Rules of arc 41 Reference types 42 Variable qualifiers Property Qualifiers 44 Getting Your hands dirty 45 Photo model Storyboard update 46 Method implementations 7 Output analysis 49 Zombies 50 Rules of memory management 51 Retain Cycles 52 Rules to avoid retain cycles 53 Common Scenarios for Retain Cycles 54 Observers 67 Returning Errors Weak Type: id 71 Solution to the problem 72 Object Longevity and Leaks Singletons Finding mystery retains Best practices 78 Memory usage in Production Summary 3. Energy. ,81 CPU 81 Table of contents Network 83 Location Manager and gPs 87 Optimal initialization 89 Turn off Inessential features Use Network Only If essential 92 Background Location Services 92 NSTimers. NsThreads, and Location service 93 Restart After App Kill 93 Screen 94 Animation 94 Video play 94 Multiple Screens 4 Other hardware 99 Battery Level and State- Aware Code Profiling for Energy Use 102 Best practices 103 Summary 106 4. Concurrent Programming Threads 107 The Cost of Threads 108 Kernel Data Structures Stac k ck SIze 108 Creation Time 10 GCD 109 Operations and Queues 110 Thread-Safe Code 112 Atomic Properties 112 Synchronized blocks 113 OCKS 115 Use Reader-Writer Locks for Concurrent Reads and writes 121 Use Immutable entities 123 Have a Central State Updater Service 128 State observers and notifications 134 Prefer async over Sync 139 Summary 141 Part ll. iOS Performance 5. Application Lifecycle. 145 pp delegate 145 Table of contents|ⅶi Application Launch 147 First launch 150 Cold Start 158 Warm Launch 166 Launch After Upgrade 169 Push notifications 169 Remote Notifications 169 Local notifications 173 Background Fetch 174 Summary 177 6. User Interface View Controller 181 183 View Hierarchy 184 View visibility 187 ew 189 UILabel 191 IBUtton 192 IMage view 194 UITable view 195 UIWeb view 199 CustonⅤiews 203 Auto layou 210 Size classes 212 New Interaction Features in ios 8 217 Interactive notifications 217 App Extensions 218 Summary 222 7. Network Metrics and measurement 223 DNS Lookup Time 224 SSL Handshake Time 226 Network t 227 Latency 234 Networking API 237 App Deployment 238 Servers 238 Request 239 Data Format 240 Tools 241 ⅶ ii Table of Contents


评论 下载该资源后可以进行评论 6

xuwwee 还可以,不是特别有用
u010617133 这个就是一些基础啊。。。
我帮你打水 还行吧,不是特别有用啊。。。。
无法显示昵称 2016年的那一版很棒的资源到iOS 9
arceushs pdf竟然这么清晰

关注 私信 TA的资源