Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Skyrocket your performance with background tasks
Search
Myracle
June 27, 2020
Programming
0
73
Skyrocket your performance with background tasks
My talk at Flutter Day India 2020 - Isolates - Background Tasks with Workmanager
Myracle
June 27, 2020
Tweet
Share
Other Decks in Programming
See All in Programming
Team operations that are not burdened by SRE
kazatohiei
1
290
LT 2025-06-30: プロダクトエンジニアの役割
yamamotok
0
680
WindowInsetsだってテストしたい
ryunen344
1
230
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
2
590
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
5
1k
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
1.8k
Kotlin エンジニアへ送る:Swift 案件に参加させられる日に備えて~似てるけど色々違う Swift の仕様 / from Kotlin to Swift
lovee
1
260
NPOでのDevinの活用
codeforeveryone
0
720
XP, Testing and ninja testing
m_seki
3
220
システム成長を止めない!本番無停止テーブル移行の全貌
sakawe_ee
1
160
AIエージェントはこう育てる - GitHub Copilot Agentとチームの共進化サイクル
koboriakira
0
490
Google Agent Development Kit でLINE Botを作ってみた
ymd65536
2
220
Featured
See All Featured
Music & Morning Musume
bryan
46
6.6k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Typedesign – Prime Four
hannesfritz
42
2.7k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
124
52k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
Raft: Consensus for Rubyists
vanstee
140
7k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Making Projects Easy
brettharned
116
6.3k
Designing for humans not robots
tammielis
253
25k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
A designer walks into a library…
pauljervisheath
207
24k
Transcript
Skyrocket your performance with Background Tasks MAX WEBER – FLUTTER
DAY INDIA 2020
About Me u Founder of FlutterExplained u Software Engineer u
Consultant u Trainer u Public Speaker @flutter_exp FlutterExplained
Intro into Background Tasks u Long Running Tasks besides of
Flutter u Your app is currently not active but performs tasks u Two different “background” states u Background State u “Destroyed” State
Isolates u Isolate is a contained instance of Dart u
It has its own uEvent Loop uMemory
Overview
We start easy…
Create an Isolate
None
Helper: compute Function u Compute is a helper function u
Creates an Isolate and runs in background u Less boilerplate u Returns a value u Limited Functionality
Isolates work fine… For apps that are in background Performs
heavy calculation tasks Allow Multi thread in Dart Speed up your applications! but… Stops when FlutterActivity is destroyed
App suspended, what now? u Plugins to the rescue u
Native Device Code starts up Flutter Engine u Runs our Dart Code u Downsides u Super code heavy u Native Code u No / Few Documentation
Documentation
Background Behavior Android u AlarmManager u JobService u Firebase Job
Dispatcher u WorkManager iOS u Minimum background fetch interval u iOS could decide never execute our code
Workmanager Package u Facilitates the u Android WorkManager u iOS
performFetchWithCompletionHandler u Reduces installation effort to a minimum u No Native Code in Kotlin or Swift
Setup WorkManager
None
CallbackDispatcher (Isolate)
Conclusion u Isolates u improve your apps performance u Careful
with “overengineering” u Background Tasks u iOS and Android have different approaches u Both are not perfectly flexible u Recommendation to use a package
Ressources u https://medium.com/vrt-digital-studio/flutter-workmanager-81e0cfbd6f6e u https://medium.com/flutter/executing-dart-in-the-background-with- flutter-plugins-and-geofencing-2b3e40a1a124 u https://flutter.dev/docs/development/packages-and-plugins/developing- packages u
https://medium.com/stuart-engineering/keep-flutter-running-background- on-android-6ffc85be0234 u https://pub.dev/packages/workmanager
” “ Thank you