Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Leveraging Program Analysis to Reduce User-Perc...

Leveraging Program Analysis to Reduce User-Perceived Latency in Mobile Applications

Presentation slides of the paper "Leveraging Program Analysis to Reduce User-Perceived Latency in Mobile Applications" at International Conference on Software Engineering (ICSE) 2018.

The presentation can be found at: https://youtu.be/8KUPsG4bByU

Yixue Zhao, PhD

May 30, 2018
Tweet

More Decks by Yixue Zhao, PhD

Other Decks in Research

Transcript

  1. Leveraging Program Analysis to Reduce User-Perceived Latency in Mobile Applications

    Yixue Zhao, Marcelo Schmitt Laser, Yingjun Lyu, and Nenad Medvidović University of Southern California May 30, 2018
  2. Outline • Existing prefetching techniques • Novel prefetching technique: PALOMA

    • Give me an example • How well does PALOMA do? • Summary & takeaways
  3. Existing Prefetching Techniques Existing approaches: • Server-based à not accessible

    • Human-based à manual & error-prone • History-based • Domain-based
  4. Existing Prefetching Techniques Existing approaches: • Server-based à not accessible

    • Human-based à manual & error-prone • History-based à time-consuming • Domain-based
  5. Existing Prefetching Techniques Existing approaches: • Server-based à not accessible

    • Human-based à manual & error-prone • History-based à time-consuming • Domain-based à not general
  6. Novel Prefetching Technique: PALOMA • Server-based • Human-based • History-based

    • Domain-based Client-only Automatic No historical data Domain-independent
  7. Meet PALOMA J Program Analysis for Latency Optimization of Mobile

    Apps • Client-only • Automatic • No historical data • Domain-independent
  8. Original App Workflow Origin Server Latency! Original App • App

    interacts with server • Network latency
  9. PALOMA Workflow Static Analysis App Instrumentation Optimized App String Analysis

    Callback Analysis Original App Proxy Runtime Prefetching Origin Server offline online
  10. PALOMA Workflow Static Analysis App Instrumentation Optimized App String Analysis

    Callback Analysis Original App Proxy Runtime Prefetching Origin Server offline online “what”
  11. PALOMA Workflow Static Analysis App Instrumentation Optimized App String Analysis

    Callback Analysis Original App Proxy Runtime Prefetching Origin Server offline online “when”
  12. PALOMA Workflow Static Analysis App Instrumentation Optimized App String Analysis

    Callback Analysis Original App Proxy Runtime Prefetching Origin Server offline online
  13. PALOMA Workflow Static Analysis App Instrumentation Optimized App String Analysis

    Callback Analysis Original App Proxy Runtime Prefetching Origin Server offline online
  14. Outline • Existing prefetching techniques • Novel prefetching technique: PALOMA

    Ø Give me an example • How well does PALOMA do? • Summary & takeaways
  15. Illustrating Example • Event app: 1. choose city name 2.

    click submit to get event information
  16. Illustrating Example • Event app: 1. choose city name 2.

    click submit to get event information
  17. Illustrating Example • Event app: 1. choose city name 2.

    click submit to get event information FINALE The original aesthetic and unconventional Do-it-Yourself attitude of the show creates a raw energy that simmers through a haze of confetti, smoke and pulsing lights.
  18. Illustrating Example • Event app: 1. choose city name 2.

    click submit to get event information • Objective: send event query before clicking submit button
  19. 1 class MainActivity{ 2 String cityName; 3 protected void onCreate(){

    4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse(connection.getInputStream()); 17 }}); 18 } 19 }
  20. 1 class MainActivity{ 2 String cityName; 3 protected void onCreate(){

    4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse(connection.getInputStream()); 17 }}); 18 } 19 }
  21. 1 class MainActivity{ 2 String cityName; 3 protected void onCreate(){

    4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse(connection.getInputStream()); 17 }}); 18 } 19 }
  22. 1 class MainActivity{ 2 String cityName; 3 protected void onCreate(){

    4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse(connection.getInputStream()); 17 }}); 18 } 19 }
  23. Static Analysis App Instrumentation Optimized App String Analysis Callback Analysis

    PALOMA Workflow Original App Proxy Runtime Prefetching Origin Server offline online
  24. String Analysis Callback Analysis Static Analysis Phase Answer “when” to

    prefetch Answer “what” to prefetch * Yellow = terms defined in the paper
  25. String Analysis Static Analysis Phase Answer “when” to prefetch Answer

    “what” to prefetch • Identify URL Spot * Yellow = terms defined in the paper Callback Analysis
  26. String Analysis Static Analysis Phase Answer “when” to prefetch Answer

    “what” to prefetch • Identify URL Spot • Static URL string value analysis Interpret concrete values * Yellow = terms defined in the paper Callback Analysis
  27. String Analysis Static Analysis Phase Answer “when” to prefetch Answer

    “what” to prefetch • Identify URL Spot • Static URL string value analysis Interpret concrete values • Dynamic URL string value analysis Identify Definition Spots * Yellow = terms defined in the paper Callback Analysis
  28. String Analysis Static Analysis Phase Answer “when” to prefetch Answer

    “what” to prefetch • Identify URL Spot • Static URL string value analysis Interpret concrete values • Dynamic URL string value analysis Identify Definition Spots • Output à URL Map { url1: [ “http://event?&cityName=”, Line7] } * Yellow = terms defined in the paper Callback Analysis
  29. String Analysis Static Analysis Phase Answer “when” to prefetch •

    Identify Target Callback * Yellow = terms defined in the paper Answer “what” to prefetch • Identify URL Spot • Static URL string value analysis Interpret concrete values • Dynamic URL string value analysis Identify Definition Spots • Output à URL Map { url1: [ “http://event?&cityName=”, Line7] } Callback Analysis
  30. String Analysis Static Analysis Phase Answer “when” to prefetch •

    Identify Target Callback • Extract Callback Control Flow Graph (CCFG) * Yellow = terms defined in the paper { url1: [ “http://event?&cityName=”, Line7] } Answer “what” to prefetch • Identify URL Spot • Static URL string value analysis Interpret concrete values • Dynamic URL string value analysis Identify Definition Spots • Output à URL Map Callback Analysis
  31. String Analysis Static Analysis Phase Answer “when” to prefetch •

    Identify Target Callback • Extract Callback Control Flow Graph (CCFG) • Identify Trigger Callback * Yellow = terms defined in the paper Answer “what” to prefetch • Identify URL Spot • Static URL string value analysis Interpret concrete values • Dynamic URL string value analysis Identify Definition Spots • Output à URL Map { url1: [ “http://event?&cityName=”, Line7] } Callback Analysis
  32. String Analysis Static Analysis Phase Answer “when” to prefetch •

    Identify Target Callback • Extract Callback Control Flow Graph (CCFG) • Identify Trigger Callback • Output à Trigger Map { [ onCreate ]: [ url1 ] } { [ onItemSelected ]: [ url1 ] } * Yellow = terms defined in the paper Answer “what” to prefetch • Identify URL Spot • Static URL string value analysis Interpret concrete values • Dynamic URL string value analysis Identify Definition Spots • Output à URL Map { url1: [ “http://event?&cityName=”, Line7] } Callback Analysis
  33. Static Analysis App Instrumentation Optimized App String Analysis Callback Analysis

    PALOMA Workflow Original App Proxy Runtime Prefetching Origin Server offline online
  34. Automatically enable prefetching 1. Update URL Map 2. Trigger prefetching

    3. Redirect Requests • Output à Optimized App App Instrumentation Phase { [ onCreate ]: [ url1 ] } { [ onItemSelected ]: [ url1 ] } { url1: [ “http://event?&cityName=”, Line7] }
  35. App Instrumentation Phase Automatically enable prefetching 1. Update URL Map

    2. Trigger prefetching 3. Redirect Requests • Output à Optimized App { [ onCreate ]: [ url1 ] } { [ onItemSelected ]: [ url1 ] } { url1: [ “http://event?&cityName=”, Line7] }
  36. { url1: [ “http://event?&cityName=”, Line7] } App Instrumentation 1 class

    MainActivity{ 2 String cityName; 3 protected void onCreate(){ 4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse(connection.getInputStream()); 17 }}); 18 } 19 } 1. Update URL Map 2. Trigger prefetching 3. Redirect Requests Definition Spot
  37. 1 class MainActivity{ 2 String cityName; 3 protected void onCreate(){

    4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse(connection.getInputStream()); 17 }}); 18 } 19 } App Instrumentation { url1: [ “http://event?&cityName=”, Line7] } 1. Update URL Map 2. Trigger prefetching 3. Redirect Requests
  38. App Instrumentation 1. Update URL Map 2. Trigger prefetching 3.

    Redirect Requests { [ onCreate ]: [ url1 ] } { [ onItemSelected ]: [ url1 ] }
  39. 1 class MainActivity{ 2 String cityName; 3 protected void onCreate(){

    4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse(connection.getInputStream()); 17 }}); 18 } 19 } App Instrumentation { [ onCreate ]: [ url1 ] } { [ onItemSelected ]: [ url1 ] } 1. Update URL Map 2. Trigger prefetching 3. Redirect Requests Trigger Callback
  40. 1 class MainActivity{ 2 String cityName; 3 protected void onCreate(){

    4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse(connection.getInputStream()); 17 }}); triggerPrefetch(url1); 18 } 19 } App Instrumentation { [ onCreate ]: [ url1 ] } { [ onItemSelected ]: [ url1 ] } 1. Update URL Map 2. Trigger prefetching 3. Redirect Requests
  41. { [ onCreate ]: [ url1 ] } { [

    onItemSelected ]: [ url1 ] } App Instrumentation 1 class MainActivity{ 2 String cityName; 3 protected void onCreate(){ 4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse(connection.getInputStream()); 17 }}); triggerPrefetch(url1); 18 } 19 } 1. Update URL Map 2. Trigger prefetching 3. Redirect Requests
  42. App Instrumentation { [ onCreate ]: [ url1 ] }

    { [ onItemSelected ]: [ url1 ] } 1 class MainActivity{ 2 String cityName; 3 protected void onCreate(){ 4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); triggerPrefetch(url1); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse(connection.getInputStream()); 17 }}); triggerPrefetch(url1); 18 } 19 } 1. Update URL Map 2. Trigger prefetching 3. Redirect Requests
  43. App Instrumentation 1 class MainActivity{ 2 String cityName; 3 protected

    void onCreate(){ 4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); triggerPrefetch(url1); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse(connection.getInputStream()); 17 }}); triggerPrefetch(url1); 18 } 19 } 1. Update URL Map 2. Trigger prefetching 3. Redirect Requests
  44. App Instrumentation 1 class MainActivity{ 2 String cityName; 3 protected

    void onCreate(){ 4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); triggerPrefetch(url1); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse( fetchFromProxy(connection) ); 17 }}); triggerPrefetch(url1); 18 } 19 } 1. Update URL Map 2. Trigger prefetching 3. Redirect Requests
  45. Static Analysis App Instrumentation Optimized App String Analysis Callback Analysis

    PALOMA Workflow Original App Proxy Runtime Prefetching Origin Server offline online
  46. 1 class MainActivity{ 2 String cityName; 3 protected void onCreate(){

    4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); triggerPrefetch(url1); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse( fetchFromProxy(connection) ); 17 }}); triggerPrefetch(url1); 18 } 19 } Runtime Prefetching Phase empty cache { url1: [ “http://event?&cityName=”, Line7] }
  47. Runtime Prefetching Phase 1 class MainActivity{ 2 String cityName; 3

    protected void onCreate(){ 4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); triggerPrefetch(url1); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse( fetchFromProxy(connection) ); 17 }}); triggerPrefetch(url1); 18 } 19 } empty cache { url1: [ “http://event?&cityName=”, Line7] }
  48. 1 class MainActivity{ 2 String cityName; 3 protected void onCreate(){

    4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); triggerPrefetch(url1); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse( fetchFromProxy(connection) ); 17 }}); triggerPrefetch(url1); 18 } 19 } Unknown Runtime Prefetching Phase empty cache { url1: [ “http://event?&cityName=”, Line7] }
  49. 1 class MainActivity{ 2 String cityName; 3 protected void onCreate(){

    4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); triggerPrefetch(url1); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse( fetchFromProxy(connection) ); 17 }}); triggerPrefetch(url1); 18 } 19 } Runtime Prefetching Phase empty cache { url1: [ “http://event?&cityName=”, Line7] }
  50. Runtime Prefetching Phase 1 class MainActivity{ 2 String cityName; 3

    protected void onCreate(){ 4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); triggerPrefetch(url1); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse( fetchFromProxy(connection) ); 17 }}); triggerPrefetch(url1); 18 } 19 } empty cache { url1: [ “http://event?&cityName=”, Line7] }
  51. Runtime Prefetching Phase 1 class MainActivity{ 2 String cityName; 3

    protected void onCreate(){ 4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); triggerPrefetch(url1); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse( fetchFromProxy(connection) ); 17 }}); triggerPrefetch(url1); 18 } 19 } empty cache { url1: [ “http://event?&cityName=”, “Berlin”] }
  52. Runtime Prefetching Phase 1 class MainActivity{ 2 String cityName; 3

    protected void onCreate(){ 4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); triggerPrefetch(url1); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse( fetchFromProxy(connection) ); 17 }}); triggerPrefetch(url1); 18 } 19 } empty cache { url1: [ “http://event?&cityName=”, “Berlin”] }
  53. Runtime Prefetching Phase 1 class MainActivity{ 2 String cityName; 3

    protected void onCreate(){ 4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); triggerPrefetch(url1); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse( fetchFromProxy(connection) ); 17 }}); triggerPrefetch(url1); 18 } 19 } empty cache { url1: [ “http://event?&cityName=Berlin”] }
  54. url1’s response Runtime Prefetching Phase 1 class MainActivity{ 2 String

    cityName; 3 protected void onCreate(){ 4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); triggerPrefetch(url1); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse( fetchFromProxy(connection) ); 17 }}); triggerPrefetch(url1); 18 } 19 }
  55. Runtime Prefetching Phase url1’s response 1 class MainActivity{ 2 String

    cityName; 3 protected void onCreate(){ 4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); triggerPrefetch(url1); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse( fetchFromProxy(connection) ); 17 }}); triggerPrefetch(url1); 18 } 19 }
  56. Runtime Prefetching Phase url1’s response 1 class MainActivity{ 2 String

    cityName; 3 protected void onCreate(){ 4 //register onItemSelected event 5 cityNameSpinner.setOnItemSelectedListener(new View.OnItemSelectedListener(){ 6 public void onItemSelected() { 7 cityName = cityNameSpinner.getSelectedItem().toString(); sendDefinition(cityName, url1, 2); triggerPrefetch(url1); 8 }}); 9 //register onClick event 10 submitBtn.setOnClickListener(new View.OnClickListener(){ 11 public void onClick(){ 12 //initialize URL 13 URL url1 = new URL("http://event?&cityName="+cityName); 14 //send HTTP request 15 URLConnection connection = url1.openConnection(); 16 Parse( fetchFromProxy(connection) ); 17 }}); triggerPrefetch(url1); 18 } 19 }
  57. FINALE The original aesthetic and unconventional Do-it-Yourself attitude of the

    show creates a raw energy that simmers through a haze of confetti, smoke and pulsing lights. Runtime Prefetching Phase url1’s response
  58. Outline • Existing prefetching techniques • Novel prefetching technique: PALOMA

    • Give me an example Ø How well does PALOMA do? • Summary & takeaways
  59. Evaluation – Microbenchmark DS1,1 1 - H DS1,1 2 -

    NP DS1,2 DS1,1 DS1,1 4 - NH DS1,2 DS1,2 5 - NP DS1,1 DS2,1 8 - NP DS1,1 DS1,1 6 - H DS2,1 DS1,1 7 - NP DS2,1 DS2,1 DS1,1 11 - NP DS2,2 DS1,1 15 - NP DS2,2 DS2,1 DS1,1 DS2,1 12 - NH DS2,2 DS1,1 13 - NP DS2,2 DS2,1 DS2,2 DS1,1 14 - NP DS2,1 DS2,1 DS2,2 DS1,2 DS1,1 DS2,2 19 - NP DS2,1 DS1,2 DS1,1 17 - NP DS2,1 DS2,2 DS1,2 DS1,1 DS1,1 18 - NP DS2,2 DS2,1 DS1,2 DS2,1 22 - NP DS2,2 DS1,2 DS1,1 DS2,2 DS2,1 DS1,2 DS1,1 DS1,1 24 - NH DS2,2 DS2,1 DS1,2 DS1,2 DS1,1 DS2,1 DS2,2 DS1,1 21 - NH DS2,1 DS2,2 DS1,2 DS1,1 10 - H DS2,2 DS2,1 DS1,1 DS2,2 9 - NP 3 - H 16 - H 20 - NP 23 - NH • 25 Test Cases # of dynamic values ≤ 2 # of Definition Spots (DS) ≤ 2
  60. Evaluation – Microbenchmark DS1,1 1 - H DS1,1 2 -

    NP DS1,2 DS1,1 DS1,1 4 - NH DS1,2 DS1,2 5 - NP DS1,1 DS2,1 8 - NP DS1,1 DS1,1 6 - H DS2,1 DS1,1 7 - NP DS2,1 DS2,1 DS1,1 11 - NP DS2,2 DS1,1 15 - NP DS2,2 DS2,1 DS1,1 DS2,1 12 - NH DS2,2 DS1,1 13 - NP DS2,2 DS2,1 DS2,2 DS1,1 14 - NP DS2,1 DS2,1 DS2,2 DS1,2 DS1,1 DS2,2 19 - NP DS2,1 DS1,2 DS1,1 17 - NP DS2,1 DS2,2 DS1,2 DS1,1 DS1,1 18 - NP DS2,2 DS2,1 DS1,2 DS2,1 22 - NP DS2,2 DS1,2 DS1,1 DS2,2 DS2,1 DS1,2 DS1,1 DS1,1 24 - NH DS2,2 DS2,1 DS1,2 DS1,2 DS1,1 DS2,1 DS2,2 DS1,1 21 - NH DS2,1 DS2,2 DS1,2 DS1,1 10 - H DS2,2 DS2,1 DS1,1 DS2,2 9 - NP 3 - H 16 - H 20 - NP 23 - NH • 25 Test Cases # of dynamic values ≤ 2 # of Definition Spots (DS) ≤ 2 • The location of DS Prefetchable Non Prefetchable (NP) Hit (H) Non Hit (NH) Trigger Point
  61. • 25 Test Cases # of dynamic values ≤ 2

    # of Definition Spots (DS) ≤ 2 • The location of DS Evaluation – Microbenchmark DS1,1 1 - H DS1,1 2 - NP DS1,2 DS1,1 DS1,1 4 - NH DS1,2 DS1,2 5 - NP DS1,1 DS2,1 8 - NP DS1,1 DS1,1 6 - H DS2,1 DS1,1 7 - NP DS2,1 DS2,1 DS1,1 11 - NP DS2,2 DS1,1 15 - NP DS2,2 DS2,1 DS1,1 DS2,1 12 - NH DS2,2 DS1,1 13 - NP DS2,2 DS2,1 DS2,2 DS1,1 14 - NP DS2,1 DS2,1 DS2,2 DS1,2 DS1,1 DS2,2 19 - NP DS2,1 DS1,2 DS1,1 17 - NP DS2,1 DS2,2 DS1,2 DS1,1 DS1,1 18 - NP DS2,2 DS2,1 DS1,2 DS2,1 22 - NP DS2,2 DS1,2 DS1,1 DS2,2 DS2,1 DS1,2 DS1,1 DS1,1 24 - NH DS2,2 DS2,1 DS1,2 DS1,2 DS1,1 DS2,1 DS2,2 DS1,1 21 - NH DS2,1 DS2,2 DS1,2 DS1,1 10 - H DS2,2 DS2,1 DS1,1 DS2,2 9 - NP 3 - H 16 - H 20 - NP 23 - NH Trigger Point Prefetchable Non Prefetchable (NP) Hit (H) Non Hit (NH)
  62. Evaluation – Microbenchmark DS1,1 1 - H DS1,1 2 -

    NP DS1,2 DS1,1 DS1,1 4 - NH DS1,2 DS1,2 5 - NP DS1,1 DS2,1 8 - NP DS1,1 DS1,1 6 - H DS2,1 DS1,1 7 - NP DS2,1 DS2,1 DS1,1 11 - NP DS2,2 DS1,1 15 - NP DS2,2 DS2,1 DS1,1 DS2,1 12 - NH DS2,2 DS1,1 13 - NP DS2,2 DS2,1 DS2,2 DS1,1 14 - NP DS2,1 DS2,1 DS2,2 DS1,2 DS1,1 DS2,2 19 - NP DS2,1 DS1,2 DS1,1 17 - NP DS2,1 DS2,2 DS1,2 DS1,1 DS1,1 18 - NP DS2,2 DS2,1 DS1,2 DS2,1 22 - NP DS2,2 DS1,2 DS1,1 DS2,2 DS2,1 DS1,2 DS1,1 DS1,1 24 - NH DS2,2 DS2,1 DS1,2 DS1,2 DS1,1 DS2,1 DS2,2 DS1,1 21 - NH DS2,1 DS2,2 DS1,2 DS1,1 10 - H DS2,2 DS2,1 DS1,1 DS2,2 9 - NP 3 - H 16 - H 20 - NP 23 - NH Prefetchable Non Prefetchable (NP) Hit (H) Non Hit (NH) • 25 Test Cases # of dynamic values ≤ 2 # of Definition Spots (DS) ≤ 2 • The location of DS Trigger Point
  63. Evaluation – Microbenchmark DS1,1 1 - H DS1,1 2 -

    NP DS1,2 DS1,1 DS1,1 4 - NH DS1,2 DS1,2 5 - NP DS1,1 DS2,1 8 - NP DS1,1 DS1,1 6 - H DS2,1 DS1,1 7 - NP DS2,1 DS2,1 DS1,1 11 - NP DS2,2 DS1,1 15 - NP DS2,2 DS2,1 DS1,1 DS2,1 12 - NH DS2,2 DS1,1 13 - NP DS2,2 DS2,1 DS2,2 DS1,1 14 - NP DS2,1 DS2,1 DS2,2 DS1,2 DS1,1 DS2,2 19 - NP DS2,1 DS1,2 DS1,1 17 - NP DS2,1 DS2,2 DS1,2 DS1,1 DS1,1 18 - NP DS2,2 DS2,1 DS1,2 DS2,1 22 - NP DS2,2 DS1,2 DS1,1 DS2,2 DS2,1 DS1,2 DS1,1 DS1,1 24 - NH DS2,2 DS2,1 DS1,2 DS1,2 DS1,1 DS2,1 DS2,2 DS1,1 21 - NH DS2,1 DS2,2 DS1,2 DS1,1 10 - H DS2,2 DS2,1 DS1,1 DS2,2 9 - NP 3 - H 16 - H 20 - NP 23 - NH • 25 Test Cases # of dynamic values ≤ 2 # of Definition Spots (DS) ≤ 2 • The location of DS Prefetchable Non Prefetchable (NP) Hit (H) Non Hit (NH) Trigger Point
  64. Evaluation – Microbenchmark • Accuracy Precision: 100% (All prefetched requests

    are prefetchable) Recall: 100% (All prefetchable requests are prefetched)
  65. Evaluation – Microbenchmark • Accuracy Precision: 100% (All prefetched requests

    are prefetchable) Recall: 100% (All prefetchable requests are prefetched) • Effectiveness Average latency reduction: 99.47% (across all Hit cases) Average overhead: 6.44ms (across all 25 cases)
  66. Evaluation – Market Apps • 32 subject apps from Google

    Play • 11 app categories • App size from 312 KB to 17.8 MB • 2 Android users exposed to all app options • 4G network setting
  67. Evaluation – Market Apps • Results across the 32 subject

    apps Min. Max. Avg. Std. Dev. Runtime Requests 1 64 13.28 14.41 Hit Rate 7.7% 100% 47.76% 28.81% Latency Reduction 87.41% 99.97% 98.82% 2.3%
  68. Takeaways Program Analysis for Latency Optimization in Mobile Apps: •

    Client-only • Automatic • Domain-independent • No historical data required
  69. Takeaways Program Analysis for Latency Optimization in Mobile Apps: •

    Significant latency reduction • Negligible overhead
  70. Takeaways Program Analysis for Latency Optimization in Mobile Apps: •

    Foundation • Rigorous formulation of prefetching scenarios • Comprehensive & reusable microbenchmark