SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
Get off my thread!
Adventures in perceived performance
Ori Peleg
Software Engineer
DroidCon TLV, June, 2014
1 Our app is stuck
2 Background service
3 Jank hunters never sleep
4 Nonblocking frenzy
5 Conclusion
Agenda
Our app is stuck
Slow activity
▪  App was stuck
▪  ~5 seconds on older devices
Slow activity
▪  App was stuck
▪  ~5 seconds on older devices
▪  ANR :-(
▪  Computed items to display
Make it faster?
▪  The app was still stuck!
▪  Turns out we were Main Thread
bandits
▪  Any work done on the main
thread
▪  Prevents UI updates
▪  Prevents interaction (touch,
back button)
Make it seem faster!
▪  The app was still stuck!
▪  Turns out we were Main Thread
bandits
▪  Any work done on the main
thread
▪  Prevents UI updates
▪  Prevents interaction (touch,
back button)
▪  AsyncTask to the rescue!
Background service still slow
Complex logic in the background
▪  “Make it a service”
▪  The app is super-slow
▪  “Separate process”
▪  The app isn’t stuck, but…
▪  Multi-process adds a lot of
complexity
Back to a single process
▪  App takes 10 seconds to load
▪  ANR :-(
▪  Can the service affect the UI’s
performance?
▪  (yes)
▪  Many dependent initialization
steps
▪  AsyncTask?
Threads
▪  Many things can happen in
parallel
▪  Main thread stays free
▪  But we create a lot of threads
Thread pools (Executors)
▪  Reuse threads
▪  Grows as needed
Jank hunters never sleep
Jank hunters
▪  We must fight to keep the
main thread free!
▪  Every Activity Service callback
is called in the main thread!
▪  Computations – too slow
▪  Network access – too slow
▪  Disk I/O?
▪  Even that is too slow
▪  StrictMode FTW
SharedPreferences
▪  In-memory cache
▪  Fast enough for the main
thread
▪  But what about editing?
▪  .commit() flushes to disk (can
block)
▪  No guarantees (no fsync)
▪  .apply() is good
Common patterns
▪  Loading images
▪  Picasso, by Square
▪  UI isn’t ready
▪  Progress indicator
▪  Some of the UI isn’t ready
▪  Show later (progress / fade in)
▪  Background processing
▪  IntentService (instead of Service)
Common errors
▪  Activity/Fragment have died
while processing
▪  Cancel work in onStop/
onDestroy
▪  Check isDestroyed/isAdded
▪  Thread-sensitive code
▪  ThreadLocal
Nonblocking frenzy manageable?
High-Velocity News – the FAST news app
▪  Fetch headlines in topic
▪  Fetch stories before you tap
▪  Simplify Concurrency with
Futures™
Futures (Guava’s extensions)
Get news feed (blocking)
Get news feed (Future)
Get news stories (parsed)
Get top news story
Display the news story
Alternatives to the callback chain
▪  Futures.transform
▪  RxJava
Conclusion get off my thread!
Simple rules to follow
▪  Be aware what’s running on which thread
▪  Remember what’s slow
▪  Offload asynchronicity to libraries
▪  Test on typical (vs high-end) devices
▪  Threads/Executors/Futures FTW
Ori Peleg
orip@fb.com

Más contenido relacionado

La actualidad más candente

Scaling Humans - BigPanda's Fabulous ChatOps Adventure - Erik Zaadi, BigPanda...
Scaling Humans - BigPanda's Fabulous ChatOps Adventure - Erik Zaadi, BigPanda...Scaling Humans - BigPanda's Fabulous ChatOps Adventure - Erik Zaadi, BigPanda...
Scaling Humans - BigPanda's Fabulous ChatOps Adventure - Erik Zaadi, BigPanda...DevOpsDays Tel Aviv
 
Mouse Logitech MX Anywhere 3
Mouse Logitech MX Anywhere 3Mouse Logitech MX Anywhere 3
Mouse Logitech MX Anywhere 3Ivano Digital
 
In the hunt of 100% delivery rate with mobile push notifications
In the hunt of 100% delivery rate with mobile push notificationsIn the hunt of 100% delivery rate with mobile push notifications
In the hunt of 100% delivery rate with mobile push notificationsJan Haložan
 
KazooCon 2014 - WebRTC
KazooCon 2014 - WebRTCKazooCon 2014 - WebRTC
KazooCon 2014 - WebRTC2600Hz
 
Building micro-web-server
Building micro-web-serverBuilding micro-web-server
Building micro-web-serverMarcio Klepacz
 
DevOps: Getting Started with Puppet on Windows
DevOps: Getting Started with Puppet on WindowsDevOps: Getting Started with Puppet on Windows
DevOps: Getting Started with Puppet on WindowsRob Reynolds
 
Expressjs from-zero-to-hero
Expressjs from-zero-to-heroExpressjs from-zero-to-hero
Expressjs from-zero-to-heroNicola Del Gobbo
 
A~Z Of Accelerator
A~Z Of AcceleratorA~Z Of Accelerator
A~Z Of Acceleratorshen liu
 
Yo pet - building a webRTC app in 20 mins
Yo pet - building a webRTC app in 20 minsYo pet - building a webRTC app in 20 mins
Yo pet - building a webRTC app in 20 minsTim Panton
 
Build your first Monster APP
Build your first Monster APPBuild your first Monster APP
Build your first Monster APP2600Hz
 
iOS 7 URL Session & Motion FX APIs
iOS 7 URL Session & Motion FX APIsiOS 7 URL Session & Motion FX APIs
iOS 7 URL Session & Motion FX APIsrsebbe
 
Moving from MAMP to Vagrant
Moving from MAMP to VagrantMoving from MAMP to Vagrant
Moving from MAMP to VagrantJeremy Pry
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuningJohn McCaffrey
 
2600hz WebRTC Meetup at WeWork, San Francisco, CA
2600hz WebRTC Meetup at WeWork, San Francisco, CA2600hz WebRTC Meetup at WeWork, San Francisco, CA
2600hz WebRTC Meetup at WeWork, San Francisco, CA2600Hz
 
Building Pistachio with Sencha Touch 2 (introductory)
Building Pistachio with Sencha Touch 2 (introductory)Building Pistachio with Sencha Touch 2 (introductory)
Building Pistachio with Sencha Touch 2 (introductory)Luis Merino
 
Erlang: TL;DR
Erlang: TL;DRErlang: TL;DR
Erlang: TL;DRvorn
 
Riak at Posterous
Riak at PosterousRiak at Posterous
Riak at Posterouscapotej
 

La actualidad más candente (19)

Scaling Humans - BigPanda's Fabulous ChatOps Adventure - Erik Zaadi, BigPanda...
Scaling Humans - BigPanda's Fabulous ChatOps Adventure - Erik Zaadi, BigPanda...Scaling Humans - BigPanda's Fabulous ChatOps Adventure - Erik Zaadi, BigPanda...
Scaling Humans - BigPanda's Fabulous ChatOps Adventure - Erik Zaadi, BigPanda...
 
Mouse Logitech MX Anywhere 3
Mouse Logitech MX Anywhere 3Mouse Logitech MX Anywhere 3
Mouse Logitech MX Anywhere 3
 
Cloud tools
Cloud toolsCloud tools
Cloud tools
 
In the hunt of 100% delivery rate with mobile push notifications
In the hunt of 100% delivery rate with mobile push notificationsIn the hunt of 100% delivery rate with mobile push notifications
In the hunt of 100% delivery rate with mobile push notifications
 
KazooCon 2014 - WebRTC
KazooCon 2014 - WebRTCKazooCon 2014 - WebRTC
KazooCon 2014 - WebRTC
 
Building micro-web-server
Building micro-web-serverBuilding micro-web-server
Building micro-web-server
 
DevOps: Getting Started with Puppet on Windows
DevOps: Getting Started with Puppet on WindowsDevOps: Getting Started with Puppet on Windows
DevOps: Getting Started with Puppet on Windows
 
Expressjs from-zero-to-hero
Expressjs from-zero-to-heroExpressjs from-zero-to-hero
Expressjs from-zero-to-hero
 
A~Z Of Accelerator
A~Z Of AcceleratorA~Z Of Accelerator
A~Z Of Accelerator
 
Yo pet - building a webRTC app in 20 mins
Yo pet - building a webRTC app in 20 minsYo pet - building a webRTC app in 20 mins
Yo pet - building a webRTC app in 20 mins
 
Build your first Monster APP
Build your first Monster APPBuild your first Monster APP
Build your first Monster APP
 
iOS 7 URL Session & Motion FX APIs
iOS 7 URL Session & Motion FX APIsiOS 7 URL Session & Motion FX APIs
iOS 7 URL Session & Motion FX APIs
 
Moving from MAMP to Vagrant
Moving from MAMP to VagrantMoving from MAMP to Vagrant
Moving from MAMP to Vagrant
 
Hacking Pebble on iOS
Hacking Pebble on iOSHacking Pebble on iOS
Hacking Pebble on iOS
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
 
2600hz WebRTC Meetup at WeWork, San Francisco, CA
2600hz WebRTC Meetup at WeWork, San Francisco, CA2600hz WebRTC Meetup at WeWork, San Francisco, CA
2600hz WebRTC Meetup at WeWork, San Francisco, CA
 
Building Pistachio with Sencha Touch 2 (introductory)
Building Pistachio with Sencha Touch 2 (introductory)Building Pistachio with Sencha Touch 2 (introductory)
Building Pistachio with Sencha Touch 2 (introductory)
 
Erlang: TL;DR
Erlang: TL;DRErlang: TL;DR
Erlang: TL;DR
 
Riak at Posterous
Riak at PosterousRiak at Posterous
Riak at Posterous
 

Destacado

Death To Passwords
Death To PasswordsDeath To Passwords
Death To PasswordsDroidConTLV
 
Hello Camera Remote API
Hello Camera Remote APIHello Camera Remote API
Hello Camera Remote APIDroidConTLV
 
The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoah...
The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoah...The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoah...
The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoah...DroidConTLV
 
Analyze and optimize Android apps power consumption
Analyze and optimize Android apps power consumptionAnalyze and optimize Android apps power consumption
Analyze and optimize Android apps power consumptionDroidConTLV
 
Adding power to your Android distribution: Eight app stores or more in 30 min...
Adding power to your Android distribution: Eight app stores or more in 30 min...Adding power to your Android distribution: Eight app stores or more in 30 min...
Adding power to your Android distribution: Eight app stores or more in 30 min...DroidConTLV
 
Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)DroidConTLV
 
Magneto - taking Android UI testing to the next level - Ran Ben Aharon, Every...
Magneto - taking Android UI testing to the next level - Ran Ben Aharon, Every...Magneto - taking Android UI testing to the next level - Ran Ben Aharon, Every...
Magneto - taking Android UI testing to the next level - Ran Ben Aharon, Every...DroidConTLV
 
Know what (not) to build - Shem Magnezi, MyRoll
Know what (not) to build - Shem Magnezi, MyRollKnow what (not) to build - Shem Magnezi, MyRoll
Know what (not) to build - Shem Magnezi, MyRollDroidConTLV
 
SquiDB: a SQLite layer for Android - Jonathan Koren, Yahoo!
SquiDB: a SQLite layer for Android - Jonathan Koren, Yahoo!SquiDB: a SQLite layer for Android - Jonathan Koren, Yahoo!
SquiDB: a SQLite layer for Android - Jonathan Koren, Yahoo!DroidConTLV
 
Build an App with Blindfold - Britt Barak
Build an App with Blindfold - Britt Barak Build an App with Blindfold - Britt Barak
Build an App with Blindfold - Britt Barak DroidConTLV
 
Think Async: Understanding the Complexity of Multithreading - Avi Kabizon & A...
Think Async: Understanding the Complexity of Multithreading - Avi Kabizon & A...Think Async: Understanding the Complexity of Multithreading - Avi Kabizon & A...
Think Async: Understanding the Complexity of Multithreading - Avi Kabizon & A...DroidConTLV
 
Knock knock! Who's there? Doze. - Yonatan Levin
Knock knock! Who's there? Doze. - Yonatan Levin Knock knock! Who's there? Doze. - Yonatan Levin
Knock knock! Who's there? Doze. - Yonatan Levin DroidConTLV
 
Good Rules for Bad Apps - Shem magnezi
Good Rules for Bad Apps - Shem magnezi Good Rules for Bad Apps - Shem magnezi
Good Rules for Bad Apps - Shem magnezi DroidConTLV
 
Optimize your delivery and quality with the right release methodology and too...
Optimize your delivery and quality with the right release methodology and too...Optimize your delivery and quality with the right release methodology and too...
Optimize your delivery and quality with the right release methodology and too...DroidConTLV
 
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...DroidConTLV
 
Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...DroidConTLV
 

Destacado (16)

Death To Passwords
Death To PasswordsDeath To Passwords
Death To Passwords
 
Hello Camera Remote API
Hello Camera Remote APIHello Camera Remote API
Hello Camera Remote API
 
The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoah...
The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoah...The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoah...
The Rounds Project: Growing from thousands to millions - Berry Ventura & Yoah...
 
Analyze and optimize Android apps power consumption
Analyze and optimize Android apps power consumptionAnalyze and optimize Android apps power consumption
Analyze and optimize Android apps power consumption
 
Adding power to your Android distribution: Eight app stores or more in 30 min...
Adding power to your Android distribution: Eight app stores or more in 30 min...Adding power to your Android distribution: Eight app stores or more in 30 min...
Adding power to your Android distribution: Eight app stores or more in 30 min...
 
Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)
 
Magneto - taking Android UI testing to the next level - Ran Ben Aharon, Every...
Magneto - taking Android UI testing to the next level - Ran Ben Aharon, Every...Magneto - taking Android UI testing to the next level - Ran Ben Aharon, Every...
Magneto - taking Android UI testing to the next level - Ran Ben Aharon, Every...
 
Know what (not) to build - Shem Magnezi, MyRoll
Know what (not) to build - Shem Magnezi, MyRollKnow what (not) to build - Shem Magnezi, MyRoll
Know what (not) to build - Shem Magnezi, MyRoll
 
SquiDB: a SQLite layer for Android - Jonathan Koren, Yahoo!
SquiDB: a SQLite layer for Android - Jonathan Koren, Yahoo!SquiDB: a SQLite layer for Android - Jonathan Koren, Yahoo!
SquiDB: a SQLite layer for Android - Jonathan Koren, Yahoo!
 
Build an App with Blindfold - Britt Barak
Build an App with Blindfold - Britt Barak Build an App with Blindfold - Britt Barak
Build an App with Blindfold - Britt Barak
 
Think Async: Understanding the Complexity of Multithreading - Avi Kabizon & A...
Think Async: Understanding the Complexity of Multithreading - Avi Kabizon & A...Think Async: Understanding the Complexity of Multithreading - Avi Kabizon & A...
Think Async: Understanding the Complexity of Multithreading - Avi Kabizon & A...
 
Knock knock! Who's there? Doze. - Yonatan Levin
Knock knock! Who's there? Doze. - Yonatan Levin Knock knock! Who's there? Doze. - Yonatan Levin
Knock knock! Who's there? Doze. - Yonatan Levin
 
Good Rules for Bad Apps - Shem magnezi
Good Rules for Bad Apps - Shem magnezi Good Rules for Bad Apps - Shem magnezi
Good Rules for Bad Apps - Shem magnezi
 
Optimize your delivery and quality with the right release methodology and too...
Optimize your delivery and quality with the right release methodology and too...Optimize your delivery and quality with the right release methodology and too...
Optimize your delivery and quality with the right release methodology and too...
 
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
 
Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...
 

Similar a Get Off My Thread! - keep your UI super-responsive

DevOps: Building by feature with immutable infrastructure at Serv.sg
DevOps: Building by feature with immutable infrastructure at Serv.sgDevOps: Building by feature with immutable infrastructure at Serv.sg
DevOps: Building by feature with immutable infrastructure at Serv.sgNicolas Mas
 
stackconf 2020 | DevOps im Mittelstand by Falk Stern
stackconf 2020 | DevOps im Mittelstand by Falk Sternstackconf 2020 | DevOps im Mittelstand by Falk Stern
stackconf 2020 | DevOps im Mittelstand by Falk SternNETWAYS
 
Python performance profiling
Python performance profilingPython performance profiling
Python performance profilingJon Haddad
 
Security in the face of adversity
Security in the face of adversitySecurity in the face of adversity
Security in the face of adversityDavid Tibbs
 
Perconalive feb-2011-share
Perconalive feb-2011-sharePerconalive feb-2011-share
Perconalive feb-2011-sharemdcallag
 
DevOps Days Vancouver 2014 Slides
DevOps Days Vancouver 2014 SlidesDevOps Days Vancouver 2014 Slides
DevOps Days Vancouver 2014 SlidesAlex Cruise
 
Android development war stories
Android development war storiesAndroid development war stories
Android development war storiesLope Emano
 
Simplicity vs. Performance NSBCon NY by Jeffrey Palermo and Andrew Siemer
Simplicity vs.Performance NSBCon NY by Jeffrey Palermo and Andrew SiemerSimplicity vs.Performance NSBCon NY by Jeffrey Palermo and Andrew Siemer
Simplicity vs. Performance NSBCon NY by Jeffrey Palermo and Andrew SiemerParticular Software
 
New Shiny in the Metasploit Framework
New Shiny in the Metasploit FrameworkNew Shiny in the Metasploit Framework
New Shiny in the Metasploit Frameworkegypt
 
The 5 Minute MySQL DBA
The 5 Minute MySQL DBAThe 5 Minute MySQL DBA
The 5 Minute MySQL DBAIrawan Soetomo
 
Practical DMD Scripting
Practical DMD Scripting Practical DMD Scripting
Practical DMD Scripting Zenoss
 
Heroes of Paragon: publishing Unity WebGL game on Facebook
Heroes of Paragon: publishing Unity WebGL game on FacebookHeroes of Paragon: publishing Unity WebGL game on Facebook
Heroes of Paragon: publishing Unity WebGL game on FacebookDevGAMM Conference
 
Everything You Were Taught About Java Is Wrong
Everything You Were Taught About Java Is WrongEverything You Were Taught About Java Is Wrong
Everything You Were Taught About Java Is WrongTim Boudreau
 
JUST EAT: Embracing DevOps
JUST EAT: Embracing DevOpsJUST EAT: Embracing DevOps
JUST EAT: Embracing DevOpsPeter Mounce
 
No locked doors, no windows barred: hacking OpenAM infrastructure
No locked doors, no windows barred: hacking OpenAM infrastructureNo locked doors, no windows barred: hacking OpenAM infrastructure
No locked doors, no windows barred: hacking OpenAM infrastructureAndrew Petukhov
 
A first look into the Project Loom in Java
A first look into the Project Loom in JavaA first look into the Project Loom in Java
A first look into the Project Loom in JavaLukas Steinbrecher
 
meetPHP#8 - PHP startups prototypes
meetPHP#8 - PHP startups prototypesmeetPHP#8 - PHP startups prototypes
meetPHP#8 - PHP startups prototypesMax Małecki
 
OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl
OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl
OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl OpenNebula Project
 
Monitoring of OpenNebula installations
Monitoring of OpenNebula installationsMonitoring of OpenNebula installations
Monitoring of OpenNebula installationsNETWAYS
 

Similar a Get Off My Thread! - keep your UI super-responsive (20)

DevOps: Building by feature with immutable infrastructure at Serv.sg
DevOps: Building by feature with immutable infrastructure at Serv.sgDevOps: Building by feature with immutable infrastructure at Serv.sg
DevOps: Building by feature with immutable infrastructure at Serv.sg
 
stackconf 2020 | DevOps im Mittelstand by Falk Stern
stackconf 2020 | DevOps im Mittelstand by Falk Sternstackconf 2020 | DevOps im Mittelstand by Falk Stern
stackconf 2020 | DevOps im Mittelstand by Falk Stern
 
Apps on Silicon
Apps on SiliconApps on Silicon
Apps on Silicon
 
Python performance profiling
Python performance profilingPython performance profiling
Python performance profiling
 
Security in the face of adversity
Security in the face of adversitySecurity in the face of adversity
Security in the face of adversity
 
Perconalive feb-2011-share
Perconalive feb-2011-sharePerconalive feb-2011-share
Perconalive feb-2011-share
 
DevOps Days Vancouver 2014 Slides
DevOps Days Vancouver 2014 SlidesDevOps Days Vancouver 2014 Slides
DevOps Days Vancouver 2014 Slides
 
Android development war stories
Android development war storiesAndroid development war stories
Android development war stories
 
Simplicity vs. Performance NSBCon NY by Jeffrey Palermo and Andrew Siemer
Simplicity vs.Performance NSBCon NY by Jeffrey Palermo and Andrew SiemerSimplicity vs.Performance NSBCon NY by Jeffrey Palermo and Andrew Siemer
Simplicity vs. Performance NSBCon NY by Jeffrey Palermo and Andrew Siemer
 
New Shiny in the Metasploit Framework
New Shiny in the Metasploit FrameworkNew Shiny in the Metasploit Framework
New Shiny in the Metasploit Framework
 
The 5 Minute MySQL DBA
The 5 Minute MySQL DBAThe 5 Minute MySQL DBA
The 5 Minute MySQL DBA
 
Practical DMD Scripting
Practical DMD Scripting Practical DMD Scripting
Practical DMD Scripting
 
Heroes of Paragon: publishing Unity WebGL game on Facebook
Heroes of Paragon: publishing Unity WebGL game on FacebookHeroes of Paragon: publishing Unity WebGL game on Facebook
Heroes of Paragon: publishing Unity WebGL game on Facebook
 
Everything You Were Taught About Java Is Wrong
Everything You Were Taught About Java Is WrongEverything You Were Taught About Java Is Wrong
Everything You Were Taught About Java Is Wrong
 
JUST EAT: Embracing DevOps
JUST EAT: Embracing DevOpsJUST EAT: Embracing DevOps
JUST EAT: Embracing DevOps
 
No locked doors, no windows barred: hacking OpenAM infrastructure
No locked doors, no windows barred: hacking OpenAM infrastructureNo locked doors, no windows barred: hacking OpenAM infrastructure
No locked doors, no windows barred: hacking OpenAM infrastructure
 
A first look into the Project Loom in Java
A first look into the Project Loom in JavaA first look into the Project Loom in Java
A first look into the Project Loom in Java
 
meetPHP#8 - PHP startups prototypes
meetPHP#8 - PHP startups prototypesmeetPHP#8 - PHP startups prototypes
meetPHP#8 - PHP startups prototypes
 
OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl
OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl
OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl
 
Monitoring of OpenNebula installations
Monitoring of OpenNebula installationsMonitoring of OpenNebula installations
Monitoring of OpenNebula installations
 

Más de DroidConTLV

Mobile Development in the Information Age - Yossi Elkrief, Nike
Mobile Development in the Information Age - Yossi Elkrief, NikeMobile Development in the Information Age - Yossi Elkrief, Nike
Mobile Development in the Information Age - Yossi Elkrief, NikeDroidConTLV
 
Doing work in the background - Darryn Campbell, Zebra Technologies
Doing work in the background - Darryn Campbell, Zebra TechnologiesDoing work in the background - Darryn Campbell, Zebra Technologies
Doing work in the background - Darryn Campbell, Zebra TechnologiesDroidConTLV
 
No more video loss - Alex Rivkin, Motorola Solutions
No more video loss - Alex Rivkin, Motorola SolutionsNo more video loss - Alex Rivkin, Motorola Solutions
No more video loss - Alex Rivkin, Motorola SolutionsDroidConTLV
 
Mobile at Scale: from startup to a big company - Dor Samet, Booking.com
Mobile at Scale: from startup to a big company - Dor Samet, Booking.comMobile at Scale: from startup to a big company - Dor Samet, Booking.com
Mobile at Scale: from startup to a big company - Dor Samet, Booking.comDroidConTLV
 
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, ClimacellLiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, ClimacellDroidConTLV
 
MVVM In real life - Lea Cohen Tannoudji, Lightricks
MVVM In real life - Lea Cohen Tannoudji, LightricksMVVM In real life - Lea Cohen Tannoudji, Lightricks
MVVM In real life - Lea Cohen Tannoudji, LightricksDroidConTLV
 
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)DroidConTLV
 
Building Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaBuilding Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaDroidConTLV
 
New Android Project: The Most Important Decisions - Vasiliy Zukanov
New Android Project: The Most Important Decisions - Vasiliy ZukanovNew Android Project: The Most Important Decisions - Vasiliy Zukanov
New Android Project: The Most Important Decisions - Vasiliy ZukanovDroidConTLV
 
Designing a Design System - Shai Mishali, Gett
Designing a Design System - Shai Mishali, GettDesigning a Design System - Shai Mishali, Gett
Designing a Design System - Shai Mishali, GettDroidConTLV
 
The Mighty Power of the Accessibility Service - Guy Griv, Pepper
The Mighty Power of the Accessibility Service - Guy Griv, PepperThe Mighty Power of the Accessibility Service - Guy Griv, Pepper
The Mighty Power of the Accessibility Service - Guy Griv, PepperDroidConTLV
 
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDevKotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDevDroidConTLV
 
Flutter State Management - Moti Bartov, Tikal
Flutter State Management - Moti Bartov, TikalFlutter State Management - Moti Bartov, Tikal
Flutter State Management - Moti Bartov, TikalDroidConTLV
 
Reactive UI in android - Gil Goldzweig Goldbaum, 10bis
Reactive UI in android - Gil Goldzweig Goldbaum, 10bisReactive UI in android - Gil Goldzweig Goldbaum, 10bis
Reactive UI in android - Gil Goldzweig Goldbaum, 10bisDroidConTLV
 
Fun with flutter animations - Divyanshu Bhargava, GoHighLevel
Fun with flutter animations - Divyanshu Bhargava, GoHighLevelFun with flutter animations - Divyanshu Bhargava, GoHighLevel
Fun with flutter animations - Divyanshu Bhargava, GoHighLevelDroidConTLV
 
DroidconTLV 2019
DroidconTLV 2019DroidconTLV 2019
DroidconTLV 2019DroidConTLV
 
Ok google, it's time to bot! - Hadar Franco, Albert + Stav Levi, Monday
Ok google, it's time to bot! - Hadar Franco, Albert + Stav Levi, MondayOk google, it's time to bot! - Hadar Franco, Albert + Stav Levi, Monday
Ok google, it's time to bot! - Hadar Franco, Albert + Stav Levi, MondayDroidConTLV
 
Introduction to React Native - Lev Vidrak, Wix
Introduction to React Native - Lev Vidrak, WixIntroduction to React Native - Lev Vidrak, Wix
Introduction to React Native - Lev Vidrak, WixDroidConTLV
 
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGeneBang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGeneDroidConTLV
 
Educating your app – adding ML edge to your apps - Maoz Tamir
Educating your app – adding ML edge to your apps - Maoz TamirEducating your app – adding ML edge to your apps - Maoz Tamir
Educating your app – adding ML edge to your apps - Maoz TamirDroidConTLV
 

Más de DroidConTLV (20)

Mobile Development in the Information Age - Yossi Elkrief, Nike
Mobile Development in the Information Age - Yossi Elkrief, NikeMobile Development in the Information Age - Yossi Elkrief, Nike
Mobile Development in the Information Age - Yossi Elkrief, Nike
 
Doing work in the background - Darryn Campbell, Zebra Technologies
Doing work in the background - Darryn Campbell, Zebra TechnologiesDoing work in the background - Darryn Campbell, Zebra Technologies
Doing work in the background - Darryn Campbell, Zebra Technologies
 
No more video loss - Alex Rivkin, Motorola Solutions
No more video loss - Alex Rivkin, Motorola SolutionsNo more video loss - Alex Rivkin, Motorola Solutions
No more video loss - Alex Rivkin, Motorola Solutions
 
Mobile at Scale: from startup to a big company - Dor Samet, Booking.com
Mobile at Scale: from startup to a big company - Dor Samet, Booking.comMobile at Scale: from startup to a big company - Dor Samet, Booking.com
Mobile at Scale: from startup to a big company - Dor Samet, Booking.com
 
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, ClimacellLiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
 
MVVM In real life - Lea Cohen Tannoudji, Lightricks
MVVM In real life - Lea Cohen Tannoudji, LightricksMVVM In real life - Lea Cohen Tannoudji, Lightricks
MVVM In real life - Lea Cohen Tannoudji, Lightricks
 
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
 
Building Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaBuilding Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice Ninja
 
New Android Project: The Most Important Decisions - Vasiliy Zukanov
New Android Project: The Most Important Decisions - Vasiliy ZukanovNew Android Project: The Most Important Decisions - Vasiliy Zukanov
New Android Project: The Most Important Decisions - Vasiliy Zukanov
 
Designing a Design System - Shai Mishali, Gett
Designing a Design System - Shai Mishali, GettDesigning a Design System - Shai Mishali, Gett
Designing a Design System - Shai Mishali, Gett
 
The Mighty Power of the Accessibility Service - Guy Griv, Pepper
The Mighty Power of the Accessibility Service - Guy Griv, PepperThe Mighty Power of the Accessibility Service - Guy Griv, Pepper
The Mighty Power of the Accessibility Service - Guy Griv, Pepper
 
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDevKotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
 
Flutter State Management - Moti Bartov, Tikal
Flutter State Management - Moti Bartov, TikalFlutter State Management - Moti Bartov, Tikal
Flutter State Management - Moti Bartov, Tikal
 
Reactive UI in android - Gil Goldzweig Goldbaum, 10bis
Reactive UI in android - Gil Goldzweig Goldbaum, 10bisReactive UI in android - Gil Goldzweig Goldbaum, 10bis
Reactive UI in android - Gil Goldzweig Goldbaum, 10bis
 
Fun with flutter animations - Divyanshu Bhargava, GoHighLevel
Fun with flutter animations - Divyanshu Bhargava, GoHighLevelFun with flutter animations - Divyanshu Bhargava, GoHighLevel
Fun with flutter animations - Divyanshu Bhargava, GoHighLevel
 
DroidconTLV 2019
DroidconTLV 2019DroidconTLV 2019
DroidconTLV 2019
 
Ok google, it's time to bot! - Hadar Franco, Albert + Stav Levi, Monday
Ok google, it's time to bot! - Hadar Franco, Albert + Stav Levi, MondayOk google, it's time to bot! - Hadar Franco, Albert + Stav Levi, Monday
Ok google, it's time to bot! - Hadar Franco, Albert + Stav Levi, Monday
 
Introduction to React Native - Lev Vidrak, Wix
Introduction to React Native - Lev Vidrak, WixIntroduction to React Native - Lev Vidrak, Wix
Introduction to React Native - Lev Vidrak, Wix
 
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGeneBang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
 
Educating your app – adding ML edge to your apps - Maoz Tamir
Educating your app – adding ML edge to your apps - Maoz TamirEducating your app – adding ML edge to your apps - Maoz Tamir
Educating your app – adding ML edge to your apps - Maoz Tamir
 

Último

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Get Off My Thread! - keep your UI super-responsive

  • 1. Get off my thread! Adventures in perceived performance Ori Peleg Software Engineer DroidCon TLV, June, 2014
  • 2. 1 Our app is stuck 2 Background service 3 Jank hunters never sleep 4 Nonblocking frenzy 5 Conclusion Agenda
  • 3. Our app is stuck
  • 4. Slow activity ▪  App was stuck ▪  ~5 seconds on older devices
  • 5. Slow activity ▪  App was stuck ▪  ~5 seconds on older devices ▪  ANR :-( ▪  Computed items to display
  • 6. Make it faster? ▪  The app was still stuck! ▪  Turns out we were Main Thread bandits ▪  Any work done on the main thread ▪  Prevents UI updates ▪  Prevents interaction (touch, back button)
  • 7. Make it seem faster! ▪  The app was still stuck! ▪  Turns out we were Main Thread bandits ▪  Any work done on the main thread ▪  Prevents UI updates ▪  Prevents interaction (touch, back button) ▪  AsyncTask to the rescue!
  • 9. Complex logic in the background ▪  “Make it a service” ▪  The app is super-slow ▪  “Separate process” ▪  The app isn’t stuck, but… ▪  Multi-process adds a lot of complexity
  • 10. Back to a single process ▪  App takes 10 seconds to load ▪  ANR :-( ▪  Can the service affect the UI’s performance? ▪  (yes) ▪  Many dependent initialization steps ▪  AsyncTask?
  • 11. Threads ▪  Many things can happen in parallel ▪  Main thread stays free ▪  But we create a lot of threads
  • 12. Thread pools (Executors) ▪  Reuse threads ▪  Grows as needed
  • 14. Jank hunters ▪  We must fight to keep the main thread free! ▪  Every Activity Service callback is called in the main thread! ▪  Computations – too slow ▪  Network access – too slow ▪  Disk I/O? ▪  Even that is too slow ▪  StrictMode FTW
  • 15. SharedPreferences ▪  In-memory cache ▪  Fast enough for the main thread ▪  But what about editing? ▪  .commit() flushes to disk (can block) ▪  No guarantees (no fsync) ▪  .apply() is good
  • 16. Common patterns ▪  Loading images ▪  Picasso, by Square ▪  UI isn’t ready ▪  Progress indicator ▪  Some of the UI isn’t ready ▪  Show later (progress / fade in) ▪  Background processing ▪  IntentService (instead of Service)
  • 17. Common errors ▪  Activity/Fragment have died while processing ▪  Cancel work in onStop/ onDestroy ▪  Check isDestroyed/isAdded ▪  Thread-sensitive code ▪  ThreadLocal
  • 19. High-Velocity News – the FAST news app ▪  Fetch headlines in topic ▪  Fetch stories before you tap ▪  Simplify Concurrency with Futures™
  • 21. Get news feed (blocking)
  • 22. Get news feed (Future)
  • 23. Get news stories (parsed)
  • 24. Get top news story
  • 26. Alternatives to the callback chain ▪  Futures.transform ▪  RxJava
  • 27. Conclusion get off my thread!
  • 28. Simple rules to follow ▪  Be aware what’s running on which thread ▪  Remember what’s slow ▪  Offload asynchronicity to libraries ▪  Test on typical (vs high-end) devices ▪  Threads/Executors/Futures FTW