2014 Mobile UI Performance: Dealing with lots of data Tina Wen – iOS Dropbox 10/10/2014 #GHC14 2014.

Slides:



Advertisements
Similar presentations
Android Application Development A Tutorial Driven Course.
Advertisements

Bruce Scharlau, University of Aberdeen, 2012 Data storage options for mobiles Mobile Computing.
ArtNotes Owen Watson Kirk Barron. This is the Navigation Bar. This a common feature of most iPhone applications This is a notebook and contains images.
A Toolbox for Blackboard Tim Roberts
My first computer: The Apple ][ It wanted to be programmed.
A Blackboard Building Block™ Crash Course for Web Developers
Mobile App Development Using: Presented by Tyler Richey Images from
Developing Custom Solutions Victor J. Pudelski. What is a Custom Solution???
IP Telephony Project By: Liane Lewin Shahar Eytan Guided By: Ran Cohen - IBM Vitali Sokhin - Technion.
1 Proprietary & Confidential Stephen Bourdeau Mobile Tech Lead TripAdvisor, LLC Hybrid App Development MoMo Mobile Camp, February 19 th, 2011.
Threads Load new page Page is loading Browser still responds to user (can read pages in other tabs)
6/13/20151 CS 160: Lecture 13 Professor John Canny Fall 2004.
Operating Systems Concepts Professor Rick Han Department of Computer Science University of Colorado at Boulder.
Inventory Management System With Berkeley DB 1. What is Berkeley DB? Berkeley DB is an Open Source embedded database library that provides scalable, high-
SE320: Introduction to Computer Games Week 8: Game Programming Gazihan Alankus.
SET-UP PROCEDURE Below is an outline for deploying new clients. We have an admin for each account. This admin delivers data to the app and allows the account.
CS378 - Mobile Computing What's Next?. Fragments Added in Android 3.0, a release aimed at tablets A fragment is a portion of the UI in an Activity multiple.
Project Rickshaw SEARCH - FIND - GO. Project Rickshaw TEAM MEMBERS KEVIN AUGUSTINO – MATT FOX – DAVID MOORE SPONSORS KARASU TECHNOLOGIES - ERIK PAUL -
St. Mark’s Community Service New Website and x2VOL Sophomores, Juniors, and Seniors August 27, 2012.
Mobile Application Development with ANDROID Tejas Lagvankar UMBC 29 April 2009.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
UI Design Patterns & Best Practices Mike Wolfson July 22, 2010.
JQuery 10/21. Today jQuery Some cool tools around the web JavaScript Libraries Drawing libraries HTML Frameworks Conventions.
DAT336 Connected vs Disconnected Data Access in ADO.NET Pablo Castro Program Manager – ADO.NET Team Microsoft Corporation.
Web/App Performance How to keep you out of the News
Moving from Web-based Collaboration to the Mobile Arena Nimrod Geva Product Group Manager, KWizCom
DUE Hello World on the Android Platform.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 7: Reveal! Displaying Pictures in a GridView.
Chapter 7: Reveal! Displaying Pictures in a Gallery.
1 Web Based Programming Section 8 James King 12 August 2003.
Using Xcode A Beginner’s Tutorial Erin Green. This tutorial will walk you through Xcode, a software development tool for Apple’s iOS applications – We.
ICDL 2004 Improving Federated Service for Non-cooperating Digital Libraries R. Shi, K. Maly, M. Zubair Department of Computer Science Old Dominion University.
ANDROID L. Grewe Components  Java Standard Development Kit (JDK) (download) (latest version)  AndroidStudio.
About These Slides This slide set is designed to be used with the OMA sample application It is recommended you follow the steps outlined in the “Preparing.
CS378 - Mobile Computing Responsiveness. An App Idea From Nifty Assignments Draw a picture use randomness Pick an equation at random Operators in the.
On the data side of the application… In the beginning, we needed to translate the ideas for the game’s dialogue progression and how the player would interact.
Review °Apply Principle of Locality Recursively °Manage memory to disk? Treat as cache Included protection as bonus, now critical Use Page Table of mappings.
1 Java Servlets l Servlets : programs that run within the context of a server, analogous to applets that run within the context of a browser. l Used to.
Presented by Christopher Wilkins Jeff Titus Stephan Krach Pablo Bajo.
 Shopping Basket  Stages to maintain shopping basket in framework  Viewing Shopping Basket.
The library is open Mobile Applications Russian-IUG November 2015 Tomsk, Russia Nabil Saadallah Manager Business Development.
B+ Trees: An IO-Aware Index Structure Lecture 13.
Feb 24-27, 2004ICDL 2004, New Dehli Improving Federated Service for Non-cooperating Digital Libraries R. Shi, K. Maly, M. Zubair Department of Computer.
Akshay Gupta Daniel Levine Michael Brandt.  A lightweight/private Facebook/Instagram for sharing photos  Allows you to create an album and share with.
By: Chisha Malama Supervisor: Dr WD Tucker Co Supervisor: Mr M. Norman.
Helping teachers connect instantly with students and parents.
If you are thinking about developing mobile application for your customer, this is an important aspect to consider the platform.
A Multi-Dimensional Configurable Access Control Framework for Mobile Applications By: Yaira K. Rivera Sánchez Major Advisor: Steven A. Demurjian.
A significant Term to ensure flawless performance Mobile App Maintenance.
CHAPTER 6 Threads, Handlers, and Programmatic Movement.
INTRODUCING HYBRID APP KAU with MICT PARK IT COMPANIES Supported by KOICA
Database Fundamentals – Part 1
Looking For Find My Pic App The first mobile app in the world that can help you save,tag,set reminders,save & send your personal pictures just one single.
3 Important Performance tracking tools in an Android Application Development Workflow Here are 3 tools every Android application developer should familiarize.
Yochay Kiriaty Senior Technical Evangelist Microsoft® Corporation
Introduction for Families
The world’s most advanced mobile platform
Chapter 2: Operating-System Structures
Get the most from the Microsoft Dynamics 365 Mobile App
Informatica PowerCenter Performance Tuning Tips
Core LIMS Training: Advanced Administration
Customizing the Social Workload
APIs and Synchronization
Building responsive apps and sites with HTML5 web workers
Android Topics Asynchronous Callsbacks
Android Topics Threads and the MessageQueue
Android Developer Fundamentals V2
To Be Safe For Now: Keep your shapefiles simple
Chapter 3: Processes.
THE ANDROID TEXTBOOK APP
Presentation transcript:

2014 Mobile UI Performance: Dealing with lots of data Tina Wen – iOS Dropbox 10/10/2014 #GHC

What’s my background?  BS & MS from MIT, 2009  Developed for Mac desktop, iOS, and web professionally  Joined Dropbox 3 years ago, largely focused on iOS development

2014 What’s your background?  Have built mobile app?  Have heard of Dropbox?  Have heard of Carousel?

2014 Quick Intro to Carousel

2014 Carousel Core Principle Your data is there, when you want it be it a picture from 10 years ago, yesterday, or one your mom sent you a second ago from the east coast!

2014 In order to load lots of data fast… Local Database UI Dropbox Persistent but slow

2014 In order to load lots of data fast… Local Database UI Dropbox Today, we’re going to focus here…

2014 …and here conversation post

2014 Two basic requirements 1. Minimize latency necessary to show photos to the user 2. Smooth animation when needed as data loads / changes

2014 Two basic requirements 1. Load data as quickly as possible from disk 2. Keep UI smooth as data loads / changes Simple, right? not with THOUSANDS of posts

2014 Main thread + drawing model MAIN THREAD (UI THREAD) Draw on screen Take input Smooth scrolling == 60 fps ≈ 16 ms/cycle Can’t load from local database on main thread

2014 Breaking it down Load from Database Propagate to UI Process data

2014 Breaking it down Load from Database Propagate to UI Process data

2014 Platform-standard solutions Android: Loaders and Cursors Problem: Cursor interface performs poorly with more than 2MB of data iOS: Core Data Problem: Often slow CUSTOM

2014 Load Benchmark Loading & processing 1,000 post metadata (content without thumbnails) from SQLite at once takes 1.55 seconds – NO GOOD!

2014 Load in Chunks Textbook solution: load in chucks  Need cursor based API for chunk loading  Can have UI load with a single cursor in chucks… …but then UI has to wait for results  Instead, use: in background keep track of cursor, load data, then notify UI

2014 Load in Chunks For each chunk: BACKGROUND 1. Load [some] data from database 2. Process for UI MAIN THREAD 3. Propagate to UI

2014 Smart Chunking Load ONLY what user sees first For us, that’s the most recent 10 posts Switch to larger chunks after Increase chunks to 1,000 posts after initial load

2014 Breaking it down Load from Database Propagate to UI Process data

2014 Database UI Data in Database is rarely exactly the same as what the UI needs Can’t process on main thread postspost photos

2014 DB UI Data in DB is rarely exactly the same as what the UI needs Obviously can’t process on main thread postspost items Main Thread = BLOCKING

2014 In memory data source  Store data source for UI in memory  UI queries only data source synchronously at render time – super fast

2014 Data Source posts 0A 1B 2C 3E 4F 5G …… Simplified Data Source Local Database UI Dropbox

2014 Data Source UI OBJECTIVE-C - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath; JAVA public abstract View getView (int position, View convertView, ViewGroup parent)

2014 But how is Data Source created?  Introducing the Accumulator (keeps in memory data source up to date as it receives updates from database)

2014 Accumulator + Data Source Individual Update Batch Update Accumulator UI posts 0A 1B 2C 3E 4F 5G …… Simplified Data Source

2014 How to deal with many sources? Simplify! API for Accumulator is just Add, Remove, and Commit One-Off: Add  Commit OR Remove  Commit Chuck load: Many Adds  Commit

Database of Posts Listener Building posts data source BACKGROUND THREAD UI (MAIN THREAD) Add Post A Append posts with Post A Add Post B Append posts with Post B Add Post A Replace old Post A with new Post A Remove Post B Remove Post B from posts Commit Sort posts array Generate posts array data source Publish to UI Set new posts array Call reloadData: … Post A Post B posts

2014 Accumulator API C++ void add_post_metadata(const DbxPostInfo &post_info); void remove_post_metadata(const string & post_id) void commit();

2014 Processing data for UI  Most apps do the processing natively  We use C++ in a library called libdropbox for cross-platform support

2014 Why C++? Why do things 2 times if I only have to do them 1 time?

2014 Introducing Djinni JNI Accumulator + Data Source UI More info at project page: Objective-C UI Libdropbox (C++) Objective-C++ JAVA

2014 Breaking it down Load from Database Propagate to UI Process data

2014 Propagating data to UI Have updated data source for UI Now just need UI to reload…right?

2014 Sure, but no animation!

2014 Sure, but no animation! Animations require context

2014 Calculating changes in data sources… ??? Old data source of Posts 0A 1B 2C 3D 4E 5F …… New data source of Posts 0A 1C 2E 3F 4D 5- ……

2014 This sounds familiar… Calculating changes in data sources…

2014 We already found deltas for Accumulator! Calculating changes in data sources…

Database of Posts ListenerOps Queue Add Post A Add Post B Add Post A Remove Post B TypeInsertion PostA TypeInsertion PostB TypeReload PostA TypeDeletion PostB Commit … posts BACKGROUND THREAD

Ops Queue Database of Posts Listener Add Post A Add Post B Add Post A Remove Post B Commit BACKGROUND THREAD TypeInsertion PostA TypeInsertion PostB TypeReload PostA TypeDeletion PostB … Post A Update UI Main Thread posts

Ops Queue Database of Posts Listener Add Post A Add Post B Add Post A Remove Post B Commit BACKGROUND THREAD TypeInsertion PostA TypeInsertion PostB TypeReload PostA TypeDeletion PostB … Post A Post B Update UI Main Thread posts

Ops Queue Database of Posts Listener Add Post A Add Post B Add Post A Remove Post B Commit BACKGROUND THREAD TypeInsertion PostA TypeInsertion PostB TypeReload PostA TypeDeletion PostB … Post A Post B Update UI Main Thread posts

Ops Queue Database of Posts Listener Add Post A Add Post B Add Post A Remove Post B Commit BACKGROUND THREAD TypeInsertion PostA TypeInsertion PostB TypeReload PostA TypeDeletion PostB … Post A Post B Update UI Main Thread posts

Ops Queue Database of Posts Listener Add Post A Add Post B Add Post A Remove Post B Commit BACKGROUND THREAD TypeInsertion PostA TypeInsertion PostB TypeReload PostA TypeDeletion PostB … Post A Update UI Main Thread posts

2014 The smooth animation

2014 Conclusions 1. Chunk load from disk for lots of data 2. Pre-process data in background to avoid blocking UI 3. Using deltas in datasets to incrementally update UI simplifies APIs and makes animating changes easy 4. For multi-platform apps, writing data model code in C++ can save a lot of time

2014 Got Feedback? Rate and Review the session using the GHC Mobile App To download visit