Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

17
Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014

Transcript of Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

Page 1: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

Procrastinator: Pacing Mobile Apps’ Usage of the Network

mobisys 2014

Page 2: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

Outline

• Motivation• Design and Implementation• Evaluation• Overhead

Page 3: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

Motivation

• App developers rely heavily on prefetching network content at the launch of an app to hide the network latency of cellular communication.

Page 4: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

Motivation

• For some users, they don’t visit off-screen content.• This waste harm three sets of users– 1. users that are always conscious about data because

they are on a pay-per-byte plan.– 2.users that start their monthly cellular billing cycle

with a large number of bytes, but eventually run low and want the remaining bytes to last them through the end of their cycle.

– 3.users that have large data plans at home but are temporarily roaming.

Page 5: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

How to save data?

• 1. It should automatically identify asynchronous network calls that are candidates for procrastination

• 2. decide whether to procrastinate each candidate call, and when to execute a previously procrastinated call.

• present Procrastinator– Instrumenter– Procrastinator Runtime

Page 6: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

How to prefetch network content?

• Three programming patterns– Pattern 1: the app developer assigns an image to an image

element that is not visible on screen. example: news reader app only top 3 or 4 is visible.

– Pattern 2: additional processing is required before displaying the fetched data. The UI elements may not be visible.

– Pattern 3: the assignment to the UI element is delayed even further. For example, weather app. At launch, the app fetches data about hurricane warnings, which it stores in a global variable. The data is used only if the user navigates to a specific tab or a “page”.

Page 7: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

Design and Implementation

Page 8: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

How to look for prefetching patterns?

• Pattern 1– the instrumenter looks for any HTTP fetch API calls

that are set to a UI element’s source.

Page 9: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

How to look for prefetching patterns?

• Pattern 2– the developer passes a callback function to the network call.

The network call asynchronously fetches data and invoke the callback with the data. The UI elements are then accessed and updated in the callback.

• static analysis:– find the callback method associated with the call– generate a conservative call graph that is rooted in the

callback method.– analyze code in the conservative call graph to discover all UI

elements being update– analyze code in the call graph to ensure it has no side effect.

Page 10: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

How to look for prefetching patterns?

• Pattern 3– two passes of static analysis– In the first pass• analyze network callbacks to identify global variables used

in store operations.(similar to Pattern 2)

– In the second pass• analyze the rest of the app code to identify code where

the same global variables are accessed in load operations.

Page 11: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

Procrastinator Runtime

• Procrastinator Runtime behavior for pattern 1,2

Page 12: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

Procrastinator Runtime

• Procrastinator Runtime behavior for pattern 3

Page 13: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

Define

• necessary– If we cannot deduce whether the content of web objects is

used in the screen, we conservatively assume them to be “necessary”

– If a web object is not necessary, then it is either “skipped” or “prefetched”

• skipped– If Procrastinator correctly deduces that a network is not

necessary and doesn’t download it.• prefetched

– If Procrastinator allows an object to be downloaded that is not necessary. (delayed)

Page 14: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

Evaluation Results

Page 15: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.
Page 16: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.
Page 17: Procrastinator: Pacing Mobile Apps’ Usage of the Network mobisys 2014.

Overhead