SlideShare a Scribd company logo
Test Your Mobile Application’s Performance
with AT&T’s Application Resource Optimizer
Doug Sillars, PhD
Application Optimization Guru
Developer Advocacy, AT&T
@dougsillars
How Fast is Your App?
How Fast is Your App?
How Fast is Your App?
“Zombies appear to be
incapable of running.
The fastest have been
observed to move at a
rate of barely one step
per 1.5 seconds.”
– Max Brooks,
Zombie Survival Guide
How Important is Speed Anyway?
Traditional Web (PC) Stats:
• Yahoo! 400ms delay leads to 5-9% drop in traffic (1)
• 1 second of latency (2)
–  Customer satisfaction drops 16%
–  Conversion to sales drops 7%
• 10 Golden Principles of Successful Web Apps:
–  “Speed is always the most important feature” (3)
Sillars’ Corollary: If speed is important on the web, it
follows that speed is even more important for mobile
• 71 % of users expect mobile sites to be as fast as desktop (4)
(1) slideshare.net/stoyan/dont-make-me-wait-or-building-highperformance-web-applications
(2) http://econsultancy.com/us/blog/10195-the-need-for-online-speed-in-america
(3) 10 Golden Principles Of Successful Web Apps http://www.businessinsider.com/10-golden-principles-successful-web-apps-2010-3
(4) http://econsultancy.com/us/blog/9162-the-importance-of-speed-for-mobile-commerce
What Do Mobile Users Expect?
High Performance Apps
•  Speed
–  64% of mobile users expect pages/apps to load in <4 seconds (1)
•  Battery Life
–  Better Battery life (6.1 satisfied of 10) !!! (2)
–  72% rate phone as very good or excellent
•  Only 21% rate battery life as very good or excellent (3)
•  Reasonable data usage
–  No one wants to hit their cap
(1) http://www.keynote.com/docs/reports/Keynote-2012-Mobile-User-Survey.pdf
(2) http://www.businessnewsdaily.com/2200-smartphone-customer-satisfaction-battery-life.html
(3) Personal communication from Swiftkey study
What Do Mobile Users Get?
Our Customers Expect More!!!!
• Top Mobile frustrations “web page slow to load” (1)
• Battery life top reported problem (2)
(1) http://www.keynote.com/docs/reports/Keynote-2012-Mobile-User-Survey.pdf
(2) http://www.businessnewsdaily.com/2200-smartphone-customer-satisfaction-battery-life.html
As a Developer, What Can I Do?
• Learn How Mobile is Different
• Optimize:
–  Learn the best practices
–  Test your application
–  Fix issues before your customers discover them
• Get ahead of the game – be ready for industry standards
and grading systems
It can’t be MY developers, they’re the best
• AT&T’s Application Resource Optimizer (ARO)
–  http://Developer.att.com/ARO
–  In 2012, <2% of tested apps required no optimization
How is Mobile Different?
Internet
IP applications
Mobile applications
Wireless
State
Machine
Mobile apps often do not consider the uniqueness of the wireless network
Optimized mobile applications improve user experience with
improved battery life and perceived faster speed
Data Transfer
LTE RRC State Machine
Timer Expiration
Radio Off Radio On
IDLE
Continuous
Reception
Tail
For AT&T’s Model:
T1 = 100ms
T2 = 20ms
T3 = 10,00ms
100ms
10s
Data Transfer
LTE RRC State Machine
Timer Expiration
Radio Off Radio On
IDLE
Continuous
Reception
Tail
• LTE has higher throughput than 3G
• This does not improve application behaviour
-  The higher power actually accentuates any issues your application might have!
100ms
10s
It’s All Connected
Application traffic triggers RRC State transitions:
•  RRC State transitions control
It’s All Connected
Application traffic triggers RRC State transitions:
•  RRC State transitions control
–  Speed/User Experience
It’s All Connected
Application traffic triggers RRC State transitions:
•  RRC State transitions control
–  Speed/User Experience
–  Device battery life
It’s All Connected
Application traffic triggers RRC State transitions:
•  RRC State transitions control
–  Speed/User Experience
–  Device battery life
–  Network efficiency
AT&T Application Resource Optimizer
• Free diagnostic tool
• Open Source
• Test any Platform
• Emulate any carrier network
• Analysis of both Native Apps and the Mobile Web
• Winner of the 2013 GSMA Smartphone Application Challenge award at
MWC
Allows YOU as a developer to SEE exactly how data
is flowing from your app!
What Platforms Can I Test With?
All of them!
• All Platforms: Pcap/tcpdump network trace
•  Ex: Wi-Fi Hotspot (like Connectify) and Wireshark/NetMon to collect
•  iOS: Remote Virtual Interface uses Instruments to collect pcap over 3G/LTE
• Android and Windows 8: Native Collector
•  Note: Android collector requires root
How Does ARO Work?
Transfer Trace Files Process Trace
Test Your Application
• PCAP only:
•  Network traffic collected
• Native Collector adds:
•  Video
•  User Input
•  Peripheral Usage
•  CPU usage
• Applies Radio and Power models
to data
• Graded against 15 Best Practices
• Learn how your application
ACTUALLY behaves!
Everyone Wins With ARO
•  Faster Response Times
•  Improved Battery Life
•  Efficient Data Plan Usage
•  Enriched User Experience
End User
•  App-specific Analysis
•  Key Areas to Improve
•  Cross Platform and
Network Agnostic
•  Free and Open Source
Developer
•  Increased Network
Availability
•  Signaling Load Reduction
•  Efficient Spectrum Usage
•  Improved Radio
Availability
Wireless Carrier
What’s the Industry Doing?
• Quality App Directory - App Quality Alliance (AQuA)
(http://www.appqualityalliance.org/)
• Smarter App Challenge – GSMA
(http://mobileappchallenge.com/smarterapp/)
• Mobile Content Action Team – CTIA
(http://www.ctia.org/business_resources/wic/index.cfm/AID/10333)
• Other carriers
• All are using ARO!! (http://developer.att.com/ARO)
• Numerous Customer facing apps help customers preserve battery and
reduce data usage
Get ahead of the game: Optimize NOW!
So, How Does ARO Make My App Faster?
ARO is the test kit to identify areas where performance
improvements exist
Simple, common sense development best practices
– Reducing connection times
– Caching files
– Eliminating Errors
The fixes identified by ARO will tune your application
to higher performance and speed
From Zombie to Sprinter in 3 Easy Steps
1. Close Connections
2. Cache Your Data
3. Manage Every Connection
From Zombie to Sprinter in 3 Easy Steps
1. Close Connections
2. Cache Your Data
3. Manage Every Connection
Closing Connections? How Does That Help?
>80% of applications
do NOT close
connections when
they are finished!
Closing Connections: Example
38% more power on LTE!
(18% more power on 3G)
Closing Connections: CODE
MultiRes Sample app from Android SDK
– Modified to download images
HttpURLConnection getimagecloseconn = (HttpURLConnection)
urln.openConnection();
getimagecloseconn.setRequestProperty("connection", "close");
getimagecloseconn.connect();
String cachecontrol = getimagecloseconn.getHeaderField("Cache-Control");
InputStream isclose = getimagecloseconn.getInputStream();
bitmap = BitmapFactory.decodeStream(isclose);
getimagecloseconn.disconnect();
https://github.com/attdevsupport/ARO/tree/master/2013DevSummitTurbocharge
From Zombie to Sprinter in 3 Easy Steps
1. Close Connections
2. Cache Your Data
3. Manage Every Connection
Caching Your Data
17% of all mobile traffic is duplicate download of
the same unaltered HTTP content (1)
“It’s just a 6 KB logo”
– 6 KB * 3 DL/session *10,000 users/day =
3.4GB/month
Reading from local cache is 75-99% faster than downloading
from the web
(1)“Web Caching on Smartphones: Ideal vs. Reality”, http://www.research.att.com/~sen/pub/Caching_mobisys12.pdf
Even if caching IS supported – it is OFF by default!!
Caching Support by Library
Android Connection Libraries iOS Libraries Android & Safari
Test Name UC HUC HC WV HRC T20 NSUR ASIHR AB SB
Basic caching ™ ™ ™ ˜ ˜ ™ ˜
Revalidation ™ ™ ™ ˜ ˜ ™ ˜ ˜ ˜ ˜
Non-caching directives ™ ™ ™ ˜ ˜ ™ ˜ » ˜ ˜
Expiration directives ™ ™ ™ ˜ ˜ ™ ˜ ˜ ˜ ˜
URL with query string ™ ™ ™ ˜ ˜ ™ ˜ ˜ ˜ ˜
Partial caching ™ ™ ™ ™ ™ ™ ™ ™ ™ ™
Redirection ™ ™ ™ ™ ™ ™ ™
Caching Methods (How do I do it?)
ETags
Cache Control Headers
• Each file has a Unique Tag
• Revalidated on server for each request
– High Performance Web Sites:
Rule 1 – Make Fewer HTTP Requests (1)
– Adding a connection drains battery,
adds 500-3,000 ms latency
• Important to carefully assign Max-Age times
• App will not check file on server until Max-Age
is reached
– Retrieval is strictly file processing time
(1) http://developer.yahoo.com/blogs/ydn/posts/2007/04/rule_1_make_few/
Comparing ETag vs. Cache Control
Network Usage Battery Drain Data Usage Speed
NO Cache
YES entire file
downloaded
Full network
connection made
High Slowest
ETag
Yes – ETag in cache
is validated on server
Full network
connection
Low Slow
Cache Control No N/A N/A Fast
Any Caching is better than no caching, but for mobile, Cache Control is preferred
Caching: Worth the Effort?
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//establish a cache
try {
File httpCacheDir = new File(getCacheDir(), "http");
long httpCacheSize = 10 * 1024 * 1024; // 10 MiB
HttpResponseCache.install(httpCacheDir, httpCacheSize);
//
}
catch (IOException e) {
Log.i(TAG, "HTTP response cache installation failed:" + e);
}
Add this!
Android 4.0:
Don’t leave older devices in the cold: Consider adding reflection for
older versions of Android
http://developer.android.com/reference/android/net/http/HttpResponseCache.html
Caching Performance
File still valid in cache
Radio never turns on
100% less
power!
MultiRes sample app – modified to add caching
98% faster!
Caching Performance
File in cache has expired,
revalidate at server
If radio has gone back to
IDLE, this can take 2.5s
LTE: 14%
less power!
MultiRes sample app – modified to add caching
3G: 30%
less power!
30% faster!
89% faster!
From Zombie to Sprinter in 3 Easy Steps
1. Close Connections
2. Cache Your Data
3. Manage Every Connection
Grouping Connections
38J of energy used!!
Imagine an app that:
1. Downloads an image every 60s
2. Downloads an Ad every 60s
3. Sends Analytics to a Server every 60s
Grouping Connections
16J of energy used!!
58% savings!
Now, look what happens if your connections are grouped together
1. Downloads an image every 60s
2. Downloads an Ad every 60s
3. Sends Analytics to a Server every 60s
16J of energy used!! 58% less energy
How Do I Group Connections
if (Tel.getDataActivity() >0){
if (Tel.getDataActivity() <4){
//ok, we are passed the minimum time to check
//and we found network activity-
//download the image here using image getter
imagegetter(counter, numberofimages);
//and show the ad
AdRequest adRequest = new AdRequest();
adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
adView.loadAd(adRequest);
// Initiate a generic request to load it with an ad
adView.loadAd(new AdRequest());
Grouping Connections for Speed
Not only can you save battery, but you can speed up your
application by managing connections properly:
Threading file downloads vs. serial download
Removing redirects to files
Pre-fetching files that are used often
Grouping Connections for Speed
Threading file downloads vs. serial download
Grouping Connections for Speed
Not only can you save battery, but you can speed up your
application by managing connections properly:
Removing redirects to files
Redirection adds ~2-3 seconds for each request
{
2 sec
Grouping Connections for Speed
Not only can you save battery, but you can speed up your
application by managing connections properly:
Pre-fetching files that are used often
More Best Practices
Look for error codes: no 4xx 5xx
HTTP response codes should occur:
More Best Practices
Look for error codes: 404s
Error messages should be short and sweet
Ad Download every 30s
More Best Practices:
Periodic Connections
Regular 3 minute Polls for updates (20% battery/day)
Summary
• Our customers expect high performance
• App performance optimizations are easy…
Once you know the issues
• Best Practices:
–  Close Connections
–  Cache Data
–  Group Connections
• Fewer connections
• Threaded Connections
• No redirects
• 4XX HTTP response codes
• Periodic Connections
everyone wins
with ARO
Developer.att.com/ARO
Developer.program@att.com
@dougsillars
thank you!

More Related Content

PPTX
Is your mobile app up to speed softwaresymposium
Doug Sillars
 
PDF
Spirent: Datum User Experience Analytics System
Sailaja Tennati
 
PPTX
Mobile Network Performance Testing
XBOSoft
 
PDF
Samsung Developer's Conference - Maximize App Performance while Minimizing Ba...
rickschwar
 
PDF
Analyze and optimize Android apps power consumption
DroidConTLV
 
PPTX
In Car Commerce - Tobin Trevarthen, Founder at Spacial Shift
wipjam
 
PPTX
ARO For Developers
Doug Sillars
 
PDF
Innovate 2013 session 1243 mobile testing.v3
Leigh Williamson
 
Is your mobile app up to speed softwaresymposium
Doug Sillars
 
Spirent: Datum User Experience Analytics System
Sailaja Tennati
 
Mobile Network Performance Testing
XBOSoft
 
Samsung Developer's Conference - Maximize App Performance while Minimizing Ba...
rickschwar
 
Analyze and optimize Android apps power consumption
DroidConTLV
 
In Car Commerce - Tobin Trevarthen, Founder at Spacial Shift
wipjam
 
ARO For Developers
Doug Sillars
 
Innovate 2013 session 1243 mobile testing.v3
Leigh Williamson
 

Similar to Doug Sillars on App Optimization (20)

PDF
Making awesome apps
DroidConTLV
 
PPTX
High Performance Apps: Tips for Speed, Power and Data
Doug Sillars
 
PDF
Big Trouble in Little Networks, new and improved
Stacy Devino
 
PDF
Big Trouble in Little Networks
Stacy Devino
 
PDF
High Performance Android Apps Improve Ratings with Speed Optimizations and Te...
azmmxqly0543
 
PPTX
Seattle AT&T Hackathon
Doug Sillars
 
PPTX
4G LTE Presentation from O\'Reilly Android Open Confereence
Alex Gaber
 
PDF
Mobile App Performance Case Studies
Sagar Desarda
 
PPTX
Bad Implementations of Good Ideas: How Systematic Inattention to Performance ...
Doug Sillars
 
PDF
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
NITHIN S.S
 
PPTX
Android App performance - Europe 2015
Doug Sillars
 
PPTX
MOBILE RIGHT NOW: What A Real Customer’s Mobile Experience Looks Like
Adrian Mendoza
 
PDF
Measuring and improving your app's network performance oredev
Doug Sillars
 
PDF
Network
Ynon Perek
 
PDF
Mobile Direct Marketing
Marketing Enablement
 
PDF
Android pro tips trilogy
Vitali Pekelis
 
ODP
Android Pro Tips - IO 13 reloaded Event
Ran Nachmany
 
PDF
3 Mobile App Dev Problems - Monospace
Frank Krueger
 
PPTX
20141007 latency prez - eng
Community motwin
 
PPTX
2015 AT&T Developer Summit
Doug Sillars
 
Making awesome apps
DroidConTLV
 
High Performance Apps: Tips for Speed, Power and Data
Doug Sillars
 
Big Trouble in Little Networks, new and improved
Stacy Devino
 
Big Trouble in Little Networks
Stacy Devino
 
High Performance Android Apps Improve Ratings with Speed Optimizations and Te...
azmmxqly0543
 
Seattle AT&T Hackathon
Doug Sillars
 
4G LTE Presentation from O\'Reilly Android Open Confereence
Alex Gaber
 
Mobile App Performance Case Studies
Sagar Desarda
 
Bad Implementations of Good Ideas: How Systematic Inattention to Performance ...
Doug Sillars
 
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
NITHIN S.S
 
Android App performance - Europe 2015
Doug Sillars
 
MOBILE RIGHT NOW: What A Real Customer’s Mobile Experience Looks Like
Adrian Mendoza
 
Measuring and improving your app's network performance oredev
Doug Sillars
 
Network
Ynon Perek
 
Mobile Direct Marketing
Marketing Enablement
 
Android pro tips trilogy
Vitali Pekelis
 
Android Pro Tips - IO 13 reloaded Event
Ran Nachmany
 
3 Mobile App Dev Problems - Monospace
Frank Krueger
 
20141007 latency prez - eng
Community motwin
 
2015 AT&T Developer Summit
Doug Sillars
 
Ad

More from wipjam (8)

PDF
WHAT IS BUSINESS TO DEVELOPER MARKETING OR B2D
wipjam
 
PPTX
Connected Car - Ian Beavis, EVP at Nielsen Global Automotive
wipjam
 
PPTX
Powering Care Coordination Through Mobility (mHealth Summit 2012 WIPJam)
wipjam
 
PPTX
Tactio on Social Apps (mHealth Summit 2012 WIPJam)
wipjam
 
PPTX
Viafo - Making Your App Social (mHealth Summit 2012 WIPJam)
wipjam
 
PPTX
George Mason University on Mobile Gamification (mHealth Summit 2012 WIPJam)
wipjam
 
PPTX
Ayogo Mobile Gamification (mHealth Summit WIPJam)
wipjam
 
PDF
Mobile Developer 101 (mHealth 2012 Edition)
wipjam
 
WHAT IS BUSINESS TO DEVELOPER MARKETING OR B2D
wipjam
 
Connected Car - Ian Beavis, EVP at Nielsen Global Automotive
wipjam
 
Powering Care Coordination Through Mobility (mHealth Summit 2012 WIPJam)
wipjam
 
Tactio on Social Apps (mHealth Summit 2012 WIPJam)
wipjam
 
Viafo - Making Your App Social (mHealth Summit 2012 WIPJam)
wipjam
 
George Mason University on Mobile Gamification (mHealth Summit 2012 WIPJam)
wipjam
 
Ayogo Mobile Gamification (mHealth Summit WIPJam)
wipjam
 
Mobile Developer 101 (mHealth 2012 Edition)
wipjam
 
Ad

Recently uploaded (20)

PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 

Doug Sillars on App Optimization

  • 1. Test Your Mobile Application’s Performance with AT&T’s Application Resource Optimizer Doug Sillars, PhD Application Optimization Guru Developer Advocacy, AT&T @dougsillars
  • 2. How Fast is Your App?
  • 3. How Fast is Your App?
  • 4. How Fast is Your App? “Zombies appear to be incapable of running. The fastest have been observed to move at a rate of barely one step per 1.5 seconds.” – Max Brooks, Zombie Survival Guide
  • 5. How Important is Speed Anyway? Traditional Web (PC) Stats: • Yahoo! 400ms delay leads to 5-9% drop in traffic (1) • 1 second of latency (2) –  Customer satisfaction drops 16% –  Conversion to sales drops 7% • 10 Golden Principles of Successful Web Apps: –  “Speed is always the most important feature” (3) Sillars’ Corollary: If speed is important on the web, it follows that speed is even more important for mobile • 71 % of users expect mobile sites to be as fast as desktop (4) (1) slideshare.net/stoyan/dont-make-me-wait-or-building-highperformance-web-applications (2) http://econsultancy.com/us/blog/10195-the-need-for-online-speed-in-america (3) 10 Golden Principles Of Successful Web Apps http://www.businessinsider.com/10-golden-principles-successful-web-apps-2010-3 (4) http://econsultancy.com/us/blog/9162-the-importance-of-speed-for-mobile-commerce
  • 6. What Do Mobile Users Expect? High Performance Apps •  Speed –  64% of mobile users expect pages/apps to load in <4 seconds (1) •  Battery Life –  Better Battery life (6.1 satisfied of 10) !!! (2) –  72% rate phone as very good or excellent •  Only 21% rate battery life as very good or excellent (3) •  Reasonable data usage –  No one wants to hit their cap (1) http://www.keynote.com/docs/reports/Keynote-2012-Mobile-User-Survey.pdf (2) http://www.businessnewsdaily.com/2200-smartphone-customer-satisfaction-battery-life.html (3) Personal communication from Swiftkey study
  • 7. What Do Mobile Users Get? Our Customers Expect More!!!! • Top Mobile frustrations “web page slow to load” (1) • Battery life top reported problem (2) (1) http://www.keynote.com/docs/reports/Keynote-2012-Mobile-User-Survey.pdf (2) http://www.businessnewsdaily.com/2200-smartphone-customer-satisfaction-battery-life.html
  • 8. As a Developer, What Can I Do? • Learn How Mobile is Different • Optimize: –  Learn the best practices –  Test your application –  Fix issues before your customers discover them • Get ahead of the game – be ready for industry standards and grading systems It can’t be MY developers, they’re the best • AT&T’s Application Resource Optimizer (ARO) –  http://Developer.att.com/ARO –  In 2012, <2% of tested apps required no optimization
  • 9. How is Mobile Different? Internet IP applications Mobile applications Wireless State Machine Mobile apps often do not consider the uniqueness of the wireless network Optimized mobile applications improve user experience with improved battery life and perceived faster speed
  • 10. Data Transfer LTE RRC State Machine Timer Expiration Radio Off Radio On IDLE Continuous Reception Tail For AT&T’s Model: T1 = 100ms T2 = 20ms T3 = 10,00ms 100ms 10s
  • 11. Data Transfer LTE RRC State Machine Timer Expiration Radio Off Radio On IDLE Continuous Reception Tail • LTE has higher throughput than 3G • This does not improve application behaviour -  The higher power actually accentuates any issues your application might have! 100ms 10s
  • 12. It’s All Connected Application traffic triggers RRC State transitions: •  RRC State transitions control
  • 13. It’s All Connected Application traffic triggers RRC State transitions: •  RRC State transitions control –  Speed/User Experience
  • 14. It’s All Connected Application traffic triggers RRC State transitions: •  RRC State transitions control –  Speed/User Experience –  Device battery life
  • 15. It’s All Connected Application traffic triggers RRC State transitions: •  RRC State transitions control –  Speed/User Experience –  Device battery life –  Network efficiency
  • 16. AT&T Application Resource Optimizer • Free diagnostic tool • Open Source • Test any Platform • Emulate any carrier network • Analysis of both Native Apps and the Mobile Web • Winner of the 2013 GSMA Smartphone Application Challenge award at MWC Allows YOU as a developer to SEE exactly how data is flowing from your app!
  • 17. What Platforms Can I Test With? All of them! • All Platforms: Pcap/tcpdump network trace •  Ex: Wi-Fi Hotspot (like Connectify) and Wireshark/NetMon to collect •  iOS: Remote Virtual Interface uses Instruments to collect pcap over 3G/LTE • Android and Windows 8: Native Collector •  Note: Android collector requires root
  • 18. How Does ARO Work? Transfer Trace Files Process Trace Test Your Application • PCAP only: •  Network traffic collected • Native Collector adds: •  Video •  User Input •  Peripheral Usage •  CPU usage • Applies Radio and Power models to data • Graded against 15 Best Practices • Learn how your application ACTUALLY behaves!
  • 19. Everyone Wins With ARO •  Faster Response Times •  Improved Battery Life •  Efficient Data Plan Usage •  Enriched User Experience End User •  App-specific Analysis •  Key Areas to Improve •  Cross Platform and Network Agnostic •  Free and Open Source Developer •  Increased Network Availability •  Signaling Load Reduction •  Efficient Spectrum Usage •  Improved Radio Availability Wireless Carrier
  • 20. What’s the Industry Doing? • Quality App Directory - App Quality Alliance (AQuA) (http://www.appqualityalliance.org/) • Smarter App Challenge – GSMA (http://mobileappchallenge.com/smarterapp/) • Mobile Content Action Team – CTIA (http://www.ctia.org/business_resources/wic/index.cfm/AID/10333) • Other carriers • All are using ARO!! (http://developer.att.com/ARO) • Numerous Customer facing apps help customers preserve battery and reduce data usage Get ahead of the game: Optimize NOW!
  • 21. So, How Does ARO Make My App Faster? ARO is the test kit to identify areas where performance improvements exist Simple, common sense development best practices – Reducing connection times – Caching files – Eliminating Errors The fixes identified by ARO will tune your application to higher performance and speed
  • 22. From Zombie to Sprinter in 3 Easy Steps 1. Close Connections 2. Cache Your Data 3. Manage Every Connection
  • 23. From Zombie to Sprinter in 3 Easy Steps 1. Close Connections 2. Cache Your Data 3. Manage Every Connection
  • 24. Closing Connections? How Does That Help? >80% of applications do NOT close connections when they are finished!
  • 25. Closing Connections: Example 38% more power on LTE! (18% more power on 3G)
  • 26. Closing Connections: CODE MultiRes Sample app from Android SDK – Modified to download images HttpURLConnection getimagecloseconn = (HttpURLConnection) urln.openConnection(); getimagecloseconn.setRequestProperty("connection", "close"); getimagecloseconn.connect(); String cachecontrol = getimagecloseconn.getHeaderField("Cache-Control"); InputStream isclose = getimagecloseconn.getInputStream(); bitmap = BitmapFactory.decodeStream(isclose); getimagecloseconn.disconnect(); https://github.com/attdevsupport/ARO/tree/master/2013DevSummitTurbocharge
  • 27. From Zombie to Sprinter in 3 Easy Steps 1. Close Connections 2. Cache Your Data 3. Manage Every Connection
  • 28. Caching Your Data 17% of all mobile traffic is duplicate download of the same unaltered HTTP content (1) “It’s just a 6 KB logo” – 6 KB * 3 DL/session *10,000 users/day = 3.4GB/month Reading from local cache is 75-99% faster than downloading from the web (1)“Web Caching on Smartphones: Ideal vs. Reality”, http://www.research.att.com/~sen/pub/Caching_mobisys12.pdf
  • 29. Even if caching IS supported – it is OFF by default!! Caching Support by Library Android Connection Libraries iOS Libraries Android & Safari Test Name UC HUC HC WV HRC T20 NSUR ASIHR AB SB Basic caching ™ ™ ™ ˜ ˜ ™ ˜ Revalidation ™ ™ ™ ˜ ˜ ™ ˜ ˜ ˜ ˜ Non-caching directives ™ ™ ™ ˜ ˜ ™ ˜ » ˜ ˜ Expiration directives ™ ™ ™ ˜ ˜ ™ ˜ ˜ ˜ ˜ URL with query string ™ ™ ™ ˜ ˜ ™ ˜ ˜ ˜ ˜ Partial caching ™ ™ ™ ™ ™ ™ ™ ™ ™ ™ Redirection ™ ™ ™ ™ ™ ™ ™
  • 30. Caching Methods (How do I do it?) ETags Cache Control Headers • Each file has a Unique Tag • Revalidated on server for each request – High Performance Web Sites: Rule 1 – Make Fewer HTTP Requests (1) – Adding a connection drains battery, adds 500-3,000 ms latency • Important to carefully assign Max-Age times • App will not check file on server until Max-Age is reached – Retrieval is strictly file processing time (1) http://developer.yahoo.com/blogs/ydn/posts/2007/04/rule_1_make_few/
  • 31. Comparing ETag vs. Cache Control Network Usage Battery Drain Data Usage Speed NO Cache YES entire file downloaded Full network connection made High Slowest ETag Yes – ETag in cache is validated on server Full network connection Low Slow Cache Control No N/A N/A Fast Any Caching is better than no caching, but for mobile, Cache Control is preferred
  • 32. Caching: Worth the Effort? public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //establish a cache try { File httpCacheDir = new File(getCacheDir(), "http"); long httpCacheSize = 10 * 1024 * 1024; // 10 MiB HttpResponseCache.install(httpCacheDir, httpCacheSize); // } catch (IOException e) { Log.i(TAG, "HTTP response cache installation failed:" + e); } Add this! Android 4.0: Don’t leave older devices in the cold: Consider adding reflection for older versions of Android http://developer.android.com/reference/android/net/http/HttpResponseCache.html
  • 33. Caching Performance File still valid in cache Radio never turns on 100% less power! MultiRes sample app – modified to add caching 98% faster!
  • 34. Caching Performance File in cache has expired, revalidate at server If radio has gone back to IDLE, this can take 2.5s LTE: 14% less power! MultiRes sample app – modified to add caching 3G: 30% less power! 30% faster! 89% faster!
  • 35. From Zombie to Sprinter in 3 Easy Steps 1. Close Connections 2. Cache Your Data 3. Manage Every Connection
  • 36. Grouping Connections 38J of energy used!! Imagine an app that: 1. Downloads an image every 60s 2. Downloads an Ad every 60s 3. Sends Analytics to a Server every 60s
  • 37. Grouping Connections 16J of energy used!! 58% savings! Now, look what happens if your connections are grouped together 1. Downloads an image every 60s 2. Downloads an Ad every 60s 3. Sends Analytics to a Server every 60s 16J of energy used!! 58% less energy
  • 38. How Do I Group Connections if (Tel.getDataActivity() >0){ if (Tel.getDataActivity() <4){ //ok, we are passed the minimum time to check //and we found network activity- //download the image here using image getter imagegetter(counter, numberofimages); //and show the ad AdRequest adRequest = new AdRequest(); adRequest.addTestDevice(AdRequest.TEST_EMULATOR); adView.loadAd(adRequest); // Initiate a generic request to load it with an ad adView.loadAd(new AdRequest());
  • 39. Grouping Connections for Speed Not only can you save battery, but you can speed up your application by managing connections properly: Threading file downloads vs. serial download Removing redirects to files Pre-fetching files that are used often
  • 40. Grouping Connections for Speed Threading file downloads vs. serial download
  • 41. Grouping Connections for Speed Not only can you save battery, but you can speed up your application by managing connections properly: Removing redirects to files Redirection adds ~2-3 seconds for each request { 2 sec
  • 42. Grouping Connections for Speed Not only can you save battery, but you can speed up your application by managing connections properly: Pre-fetching files that are used often
  • 43. More Best Practices Look for error codes: no 4xx 5xx HTTP response codes should occur:
  • 44. More Best Practices Look for error codes: 404s Error messages should be short and sweet
  • 45. Ad Download every 30s More Best Practices: Periodic Connections Regular 3 minute Polls for updates (20% battery/day)
  • 46. Summary • Our customers expect high performance • App performance optimizations are easy… Once you know the issues • Best Practices: –  Close Connections –  Cache Data –  Group Connections • Fewer connections • Threaded Connections • No redirects • 4XX HTTP response codes • Periodic Connections