mobile measurements: the mobile app / OS perspective Why - - PowerPoint PPT Presentation

mobile measurements the mobile app os perspective
SMART_READER_LITE
LIVE PREVIEW

mobile measurements: the mobile app / OS perspective Why - - PowerPoint PPT Presentation

mobile measurements: the mobile app / OS perspective Why understanding mobile app performance is hard cellular performance matters to some apps most demanding apps multiplayer gaming VoIP video chat somewhat demanding web


slide-1
SLIDE 1

mobile measurements: the mobile app / OS perspective

Why understanding mobile app performance is hard

slide-2
SLIDE 2

cellular performance matters to some apps

  • most demanding apps
  • multiplayer gaming
  • VoIP
  • video chat
  • somewhat demanding
  • web search
  • app interfaces with web services
  • reasonably irrelevant
  • network transfers that aren’t in the critical path

26.March.2014 sharad.agarwal@microsoft.com 2

slide-3
SLIDE 3

app development environment

26.March.2014 sharad.agarwal@microsoft.com 3

slide-4
SLIDE 4

Start screen icons

26.March.2014 sharad.agarwal@microsoft.com 4

slide-5
SLIDE 5

The Weather Channel

26.March.2014 sharad.agarwal@microsoft.com 5

slide-6
SLIDE 6

Mitt Rating Mitt Rating

26.March.2014 sharad.agarwal@microsoft.com 6

slide-7
SLIDE 7

Mitt Rating Mitt Rating Mitt Rating Mitt Rating

26.March.2014 sharad.agarwal@microsoft.com 7

slide-8
SLIDE 8

Mitt Rating Mitt Rating

26.March.2014 sharad.agarwal@microsoft.com 8

slide-9
SLIDE 9

Internet

Mitt Romney

Mitt Rating Mitt Rating

26.March.2014 sharad.agarwal@microsoft.com 9

slide-10
SLIDE 10

Internet

“Mitt Romney might vote for Obama as well” “We recommend Mitt Romney for president” “I would definitely trust Mitt Romney with my money.” “If I had a nickel for every time Mitt Romney said something stupid I'd be in his tax bracket”

Mitt Romney

Mitt Rating Mitt Rating

Tweets

26.March.2014 sharad.agarwal@microsoft.com 10

slide-11
SLIDE 11

Internet

“Mitt Romney might vote for Obama as well” “We recommend Mitt Romney for president” “I would definitely trust Mitt Romney with my money.” “If I had a nickel for every time Mitt Romney said something stupid I'd be in his tax bracket”

Mitt Romney

Mitt Rating Mitt Rating

Tweets

26.March.2014 sharad.agarwal@microsoft.com 11

slide-12
SLIDE 12

Internet

53%

“Mitt Romney might vote for Obama as well” “We recommend Mitt Romney for president” “I would definitely trust Mitt Romney with my money.” “If I had a nickel for every time Mitt Romney said something stupid I'd be in his tax bracket”

Mitt Romney

Mitt Rating Mitt Rating

Tweets

26.March.2014 sharad.agarwal@microsoft.com 12

slide-13
SLIDE 13

53%

Mitt Rating Mitt Rating

Hypothetical Synchronous Code

26.March.2014 sharad.agarwal@microsoft.com 13

slide-14
SLIDE 14

ClickHandler() { }

53%

Mitt Rating Mitt Rating

Hypothetical Synchronous Code

26.March.2014 sharad.agarwal@microsoft.com 14

slide-15
SLIDE 15

ClickHandler() { tweets = HttpGet(url); }

53%

Mitt Rating Mitt Rating

Hypothetical Synchronous Code

26.March.2014 sharad.agarwal@microsoft.com 15

slide-16
SLIDE 16

ClickHandler() { tweets = HttpGet(url); rating = ProcessTweets(tweets); } ProcessTweets(tweets) { ... }

53%

Mitt Rating Mitt Rating

Hypothetical Synchronous Code

26.March.2014 sharad.agarwal@microsoft.com 16

slide-17
SLIDE 17

ClickHandler() { tweets = HttpGet(url); rating = ProcessTweets(tweets); display.Text = rating; } ProcessTweets(tweets) { ... }

53%

Mitt Rating Mitt Rating

Hypothetical Synchronous Code

26.March.2014 sharad.agarwal@microsoft.com 17

slide-18
SLIDE 18

ClickHandler() { tweets = HttpGet(url); rating = ProcessTweets(tweets); display.Text = rating; } ProcessTweets(tweets) { ... }

Click Handler Start Click Handler End

Thread

53%

Mitt Rating Mitt Rating

Hypothetical Synchronous Code

26.March.2014 sharad.agarwal@microsoft.com 18

slide-19
SLIDE 19

ClickHandler() { tweets = HttpGet(url); rating = ProcessTweets(tweets); display.Text = rating; } ProcessTweets(tweets) { ... }

Click Handler Start Click Handler End

Thread

User Perceived Delay

53%

Mitt Rating Mitt Rating

Hypothetical Synchronous Code

26.March.2014 sharad.agarwal@microsoft.com 19

slide-20
SLIDE 20

Mitt Rating Mitt Rating

53%

Asynchronous Code

26.March.2014 sharad.agarwal@microsoft.com 20

slide-21
SLIDE 21

ClickHandler() { AsyncHttpGet(url, DownloadCallback); } DownloadCallback(tweets) { rating = ProcessTweets(tweets); UIDispatch(DisplayRating, rating); } DisplayRating(rating) { display.Text = rating; } ProcessTweets(tweets) { ... }

Mitt Rating Mitt Rating

53%

Asynchronous Code

26.March.2014 sharad.agarwal@microsoft.com 21

slide-22
SLIDE 22

ClickHandler() { AsyncHttpGet(url, DownloadCallback); } DownloadCallback(tweets) { rating = ProcessTweets(tweets); UIDispatch(DisplayRating, rating); } DisplayRating(rating) { display.Text = rating; } ProcessTweets(tweets) { ... }

UI Thread

ClickHandler End ClickHandler Start

Mitt Rating Mitt Rating

53%

User Click

Asynchronous Code

26.March.2014 sharad.agarwal@microsoft.com 22

slide-23
SLIDE 23

ClickHandler() { AsyncHttpGet(url, DownloadCallback); } DownloadCallback(tweets) { rating = ProcessTweets(tweets); UIDispatch(DisplayRating, rating); } DisplayRating(rating) { display.Text = rating; } ProcessTweets(tweets) { ... }

UI Thread

ClickHandler End ClickHandler Start

Mitt Rating Mitt Rating

System

Async Get Call

53%

User Click

Asynchronous Code

26.March.2014 sharad.agarwal@microsoft.com 23

slide-24
SLIDE 24

ClickHandler() { AsyncHttpGet(url, DownloadCallback); } DownloadCallback(tweets) { rating = ProcessTweets(tweets); UIDispatch(DisplayRating, rating); } DisplayRating(rating) { display.Text = rating; } ProcessTweets(tweets) { ... }

UI Thread Background Thread

ClickHandler End ClickHandler Start

Mitt Rating Mitt Rating

System

Async Get Call ProcessTweets Download Callback

53%

User Click

Asynchronous Code

26.March.2014 sharad.agarwal@microsoft.com 24

slide-25
SLIDE 25

ClickHandler() { AsyncHttpGet(url, DownloadCallback); } DownloadCallback(tweets) { rating = ProcessTweets(tweets); UIDispatch(DisplayRating, rating); } DisplayRating(rating) { display.Text = rating; } ProcessTweets(tweets) { ... }

UI Thread Background Thread

UI Dispatch ClickHandler End ClickHandler Start

Mitt Rating Mitt Rating

System

Async Get Call ProcessTweets Download Callback

53%

User Click

Asynchronous Code

26.March.2014 sharad.agarwal@microsoft.com 25

slide-26
SLIDE 26

ClickHandler() { AsyncHttpGet(url, DownloadCallback); } DownloadCallback(tweets) { rating = ProcessTweets(tweets); UIDispatch(DisplayRating, rating); } DisplayRating(rating) { display.Text = rating; } ProcessTweets(tweets) { ... }

Display Rating

UI Thread Background Thread

UI Dispatch ClickHandler End ClickHandler Start

Mitt Rating Mitt Rating

System

Async Get Call ProcessTweets Download Callback

53%

User Click

Asynchronous Code

26.March.2014 sharad.agarwal@microsoft.com 26

slide-27
SLIDE 27

Apps are highly asynchronous

30 popular apps 167,000 transactions from user study

26.March.2014 sharad.agarwal@microsoft.com 27

slide-28
SLIDE 28

Apps are highly asynchronous

30 popular apps 167,000 transactions from user study

  • On average, 19 asynchronous calls per user transaction
  • On average, 8 parallel threads per user transaction

26.March.2014 sharad.agarwal@microsoft.com 28

slide-29
SLIDE 29

Apps are highly asynchronous

For each user transaction, what was the critical path, and did the network matter?

30 popular apps 167,000 transactions from user study

  • On average, 19 asynchronous calls per user transaction
  • On average, 8 parallel threads per user transaction

26.March.2014 sharad.agarwal@microsoft.com 29

slide-30
SLIDE 30

Mitt Rating Mitt Rating 26.March.2014 sharad.agarwal@microsoft.com 30

slide-31
SLIDE 31

Tweets

Mitt Rating Mitt Rating 26.March.2014 sharad.agarwal@microsoft.com 31

slide-32
SLIDE 32

Tweets Posts

Mitt Rating Mitt Rating 26.March.2014 sharad.agarwal@microsoft.com 32

slide-33
SLIDE 33

Tweets Posts

Mitt Rating Mitt Rating 26.March.2014 sharad.agarwal@microsoft.com 33

slide-34
SLIDE 34

Tweets Posts

Mitt Rating Mitt Rating

47%

26.March.2014 sharad.agarwal@microsoft.com 34

slide-35
SLIDE 35

UI Thread Background Thread Background Thread Background Thread

User Transaction

Tweets Posts

Mitt Rating Mitt Rating

47%

26.March.2014 sharad.agarwal@microsoft.com 35

slide-36
SLIDE 36

UI Thread Background Thread Background Thread Background Thread

User Transaction

Tweets Posts

Mitt Rating Mitt Rating

47%

User Click

26.March.2014 sharad.agarwal@microsoft.com 36

slide-37
SLIDE 37

UI Thread Background Thread Background Thread Background Thread

Twitter Thread Blocked

User Transaction

Tweets Posts

Facebook

Mitt Rating Mitt Rating

47%

User Click

26.March.2014 sharad.agarwal@microsoft.com 37

slide-38
SLIDE 38

UI Thread Background Thread Background Thread Background Thread

Twitter Thread Blocked Fire

User Transaction

Callback

Tweets Posts

Twitter Process Tweets Facebook

Mitt Rating Mitt Rating

47%

User Click

26.March.2014 sharad.agarwal@microsoft.com 38

slide-39
SLIDE 39

UI Thread Background Thread Background Thread Background Thread

Twitter Thread Blocked Fire Fire

User Transaction

Callback Callback

Tweets Posts

Twitter Facebook Process Posts Process Tweets Facebook

Mitt Rating Mitt Rating

47%

User Click

26.March.2014 sharad.agarwal@microsoft.com 39

slide-40
SLIDE 40

UI Thread Background Thread Background Thread Background Thread

Twitter Thread Wakeup Thread Blocked Fire Fire Display

User Transaction

Callback Callback

Tweets Posts

Twitter Facebook Process Posts Process Tweets Facebook

Mitt Rating Mitt Rating

47%

User Click

26.March.2014 sharad.agarwal@microsoft.com 40

slide-41
SLIDE 41

UI Thread Background Thread Background Thread Background Thread

User Click Twitter Thread Wakeup Thread Blocked Fire Fire Callback Callback Twitter Facebook Process Posts Process Tweets Facebook

User Transaction

Display

26.March.2014 sharad.agarwal@microsoft.com 41

slide-42
SLIDE 42

UI Thread Background Thread Background Thread Background Thread

User Click Twitter Thread Wakeup Thread Blocked Fire Fire Callback Callback Twitter Facebook Process Posts Process Tweets Facebook

User Transaction

Display

26.March.2014 sharad.agarwal@microsoft.com 42

slide-43
SLIDE 43

UI Thread Background Thread Background Thread Background Thread

User Click Twitter Thread Wakeup Thread Blocked Fire Fire Callback Callback Twitter Facebook Process Posts Process Tweets Facebook

Critical Path

User Transaction

Display

26.March.2014 sharad.agarwal@microsoft.com 43

slide-44
SLIDE 44

UI Thread Background Thread Background Thread Background Thread

User Click Twitter Thread Wakeup Thread Blocked Fire Fire Callback Callback Twitter Facebook Process Posts Process Tweets Facebook

Critical Path

Optimizing the critical path reduces the user perceived delay

User Transaction

Display

26.March.2014 sharad.agarwal@microsoft.com 44

slide-45
SLIDE 45

UI Thread Background Thread Background Thread Background Thread

User Click Twitter Thread Wakeup Thread Blocked Fire Fire Callback Callback Twitter Facebook Process Posts Process Tweets Facebook

Critical Path

Optimizing the critical path reduces the user perceived delay

User Transaction

Display

26.March.2014 sharad.agarwal@microsoft.com 45

slide-46
SLIDE 46

key points

  • app pages designed in GUI
  • async interfaces in code to UI elements
  • async interfaces to network
  • tendency to fetch many network objects at launch
  • fetch‐parse‐fetch pattern
  • critical path is hard to determine
  • in which user transactions does network matter?
  • of those, what caused network delay, if any?

26.March.2014 sharad.agarwal@microsoft.com 46

slide-47
SLIDE 47

cellular network complicates this even more

  • radio power states

26.March.2014 sharad.agarwal@microsoft.com 47

slide-48
SLIDE 48

cellular network complicates this even more

  • radio power states
  • latency varies by load

26.March.2014 sharad.agarwal@microsoft.com 48

slide-49
SLIDE 49

cellular network complicates this even more

  • radio power states
  • latency varies by load

26.March.2014 sharad.agarwal@microsoft.com 49

0.2 0.4 0.6 0.8 1 120 170 220 empirical CDF RTT (ms)

slide-50
SLIDE 50

cellular network complicates this even more

  • radio power states
  • latency varies by load
  • latency varies
  • ver space

26.March.2014 sharad.agarwal@microsoft.com 50

0.2 0.4 0.6 0.8 1 50 100 150 200 empirical CDF RTT difference at 90th percentile (ms)

slide-51
SLIDE 51

why am I telling you all this?

  • wireless BW, latency, RSSI, etc. data is useful for

research

  • relate it to user experience
  • this is hard because of how apps are built
  • need detailed & efficient app instrumentation
  • our mobile OS throttles some network behavior
  • based on app performance need and cellular data limits
  • research systems to do this on a per app transfer basis,

using detailed & lightweight instrumentation

  • need detailed, predictive wireless performance info &

how individual parts of apps are affected by net perf

26.March.2014 sharad.agarwal@microsoft.com 51

slide-52
SLIDE 52

for more details

  • cellular performance variations in short timescales
  • Switchboard paper in ACM MobiSys 2011
  • asynchronous nature of apps & perf measurement
  • AppInsight paper in USENIX OSDI 2012
  • network fetching behavior of apps
  • Procrastinator paper in ACM MobiSys 2014

26.March.2014 sharad.agarwal@microsoft.com 52