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

Perception Of Speed

cmota
August 15, 2016

Perception Of Speed

What's our main complaint when we use an application?

- Speed!

We all expect speed. We want to access everything from the point of our fingers and we want that as fast as possible. When an application is taking to long to open or process some data I bet you also feel the urge to search for another solution - or just to throw your smartphone against the nearest wall in despair. And while you think about this, you’re looking at that never ending spinner… that... it just doesn't seem to go away.

- Google Play and the App Store are full of similar solutions... Why should I bother to keep using this one?

We can make all sort of optimisations on our code - and yet, sometimes, we can't really make that process as fast as we wanted. There are always some constraints that we can't really avoid - device limitations, network, server, etc. but we can create the illusion of speed - a visual aid that keeps the user busy while, on the background, we are processing his action.

Yes. Time is relative and we want the users to feel that every action is as responsible as possible.

cmota

August 15, 2016
Tweet

More Decks by cmota

Other Decks in Technology

Transcript

  1. 3

  2. 1 - Hardware 2 - Software 3 - Perception Usain

     Bolt:  100m  in  just  9.58s 5
  3. Usain  Bolt:  150m  in  just  14.35s 1983 Motorola DynaTAC 8000X

    dark ages First cellphone ever 1993 BellSouth/IBM Simon First phone/PDA combo Apps: alarm, calculator… Stores up to 30 contacts Nokia 9000 First smartphone 8MB Storage 1996 2000 Nokia 3310 Snake iPhone 6S iOS 9 Dual-core 1.84GHz PowerVR GT7600 2015 12 MP (2160p) Apple Pay, Fingerprint… LG Nexus 5x 2GB RAM (Apple A9) Android M Quad-core 1.44GHz Adreno 418 12 MP (2160p) NFC, Fingerprint… 2GB RAM (Snapdragon) 1999 Sam sung SPH-M 100 M P3 2002 Sanyo SCP-5300 Cam era 2008 iPhone 3G T-Mobile G1/ HTC Dream Android 1.5 iOS 2.0 528 MHz ARM 11 192 MB RAM 412 MHz ARM 11 128 MB RAM 7
  4. There are mobile experiences out there that are so good,

    that … we need to have the highest quality, and the only way is doing native. - Mark Zuckerberg, CEO of Facebook, about changing the app from HTML5 to native 9
  5. Performance  Tips In JAVA using the for-each loop is 3x

    faster to iterate over a list than the for loop? Did you know: On effective Java by Joshua Bloch 13
  6. Performance  Tips Using floating-point is 2x slower than integer on

    Android- powered devices? Did you know: On Android Developers blog 14
  7. Performance  Study:  REST  vs  SOAP  for  Mobile  Applications Oracle A-Team

    Samsung Galaxy S4 iPhone 4S iPad 2 Time in (ms) 0 2500 5000 7500 10000 SOAP REST-XML REST-JSON 16
  8. Data  format JSON { "pages": [ { "id": "lets_get_started", "title_string_key":

    "wizard_title_1page", "text_string_key": "wizard_details_1page", "image_name": bg_oobe_lets_get_started”, "can_show_again": true, "mandatory": false, "active": true }, { "id": "time_to_chat", "title_string_key": "wizard_title_2page", "text_string_key": "wizard_details_2page", "image_name": "bg_oobe_time_to_chat", "can_show_again": true, "mandatory": false, "active": true }, { "id": "share_life", "title_string_key": "wizard_title_3page", "text_string_key": "wizard_details_3page", "image_name": "bg_oobe_share_life", "can_show_again": true, "mandatory": false, "active": true }, { "id": "call_friends", "title_string_key": "wizard_title_4page", "text_string_key": "wizard_details_4page", "image_name": "bg_oobe_call_friends", "can_show_again": true, "mandatory": false, "active": true }, { "id": "fun_for_all", "title_string_key": "wizard_title_5page", "text_string_key": "wizard_details_5page", "image_name": "bg_oobe_fun_for_all", "can_show_again": true, "mandatory": false, "active": true }, { "id": "smart_calling", "title_string_key": "wizard_title_7page", "text_string_key" : "wizard_details_7page", "image_name": "bg_oobe_smart_calling", "can_show_again" : true, "mandatory" : false, "active" : true }, { "id": “start_messaging", "title_string_key": "wizard_title_8page", "text_string_key": "wizard_details_8page", "image_name": “bg_oobe_start_messaging", "can_show_again": true, "mandatory": false, "active": true }, { "id": “start_calling", "title_string_key": "wizard_title_9page", "text_string_key" : "wizard_details_9page", "image_name": "bg_oobe_start_calling", "can_show_again" : true, "mandatory" : false, "active" : true }, { "id": "add_shortcut", "fragment": “com.app.oobe.OobePageFragment", "can_show_again": false, "mandatory": true, "active": true } ] } 17
  9. Advanced version of ListView Higher performance Higher flexibility View Holder

    pattern Built-in (beautifully) animation library Backward supported until Android 2.1 RecyclerView 18
  10. Performance  Tips Activity loads in ~400ms Avoid using the UI-thread

    for long running operations Don’t try to reinvent the wheel Open-source libraries (used by millions) Support package for backwards compatibility 20
  11. Reduce view hierarchy Avoid overdraw Use hardware acceleration RenderScript Performance

     Tips 26 Lorem ipsum dolor sit amet lorem ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing elit PerceptionOfSpeed
  12. Reduce view hierarchy Avoid overdraw Use hardware acceleration RenderScript john

    doe jane doe john doe john doe jane doe john doe 5 mins ago 5 mins ago 15 mins ago 35 mins ago 1 hour ago 1 hour ago Performance  Tips 27 Lorem ipsum dolor sit amet lorem ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing elit PerceptionOfSpeed
  13. Reduce view hierarchy Avoid overdraw Use hardware acceleration RenderScript john

    doe jane doe john doe john doe jane doe john doe 5 mins ago 5 mins ago 15 mins ago 35 mins ago 1 hour ago 1 hour ago Performance  Tips 28 Lorem ipsum dolor sit amet lorem ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing elit PerceptionOfSpeed
  14. Reduce view hierarchy Avoid overdraw Use hardware acceleration RenderScript john

    doe jane doe john doe john doe jane doe john doe 5 mins ago 5 mins ago 15 mins ago 35 mins ago 1 hour ago 1 hour ago Performance  Tips 29 Lorem ipsum dolor sit amet lorem ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing elit PerceptionOfSpeed
  15. Performance  Tips do work that you don’t need to allocate

    memory if you can avoid it fetch everything Don’t 30
  16. 34

  17. 35

  18. 1 - Perform actions optimistically 2 - Adaptively pre-load content

    3 - Move bits when no-one’s watching Instagram’s  Manifesto according to Mike Krieger, Instagram’s co-founder 49
  19. <100ms <1s 10s Usain  Bolt:  300m  in  just  30.97s -

    - - Feels instantaneous Keep flow of thought Keep attention 58 by Jakob Nielsen, Usability Engineering
  20. <16ms <100ms <1s >1s Usain  Bolt:  400m  in  just  45.28s

    - - - - Like butter Lower is better Give them a break All hell breaks lose by Allen Pike, steam clock software 59
  21. <16ms <100ms <1s >1s Usain  Bolt:  400m  in  just  45.28s

    - - - - Like butter Lower is better Give them a break All hell breaks lose by Allen Pike, steam clock software 61
  22. Avoid  the  Spinner 67 There seems to be an excessive

    amount of waiting around for pages to refresh and load - it doesn't seem as quick as the previous version. - users After adding a spinner to an empty view:
  23. Remove  network  from  user  flow 70 Liking photo… Cancel A

    few more seconds… We’re really trying to make this request work. How are you today? Çup? Done! We’re going to dismiss the dialog now A few seconds… View Controller Network
  24. Paper 76 The perception of the response time is minimised

    by the app animation. Paper starts to load things before you’ve fully expanded the card. fluid Keeps browsing and fast
  25. Google  Plus  App 79 New posts! Touch to see them

    Detect new posts Notify user Fetch content Refresh UI
  26. Average time: 3.00s Google  Plus  App 80 New posts! Touch

    to see them Detect new posts Notify user Fetch content Refresh UI Detect new posts Fetch content Notify user Refresh UI Average time: 0.35s Perceived speed increased 9x
  27. Learn to care Convince others to care Be creative Always

    keep the user in mind Eat your own dog food 83 Ongoing  performance