SlideShare a Scribd company logo
1
MIND YOUR APP FOOTPRINT! 🐾⚡🌱
How to Test & Reduce your Mobile App Footprint
#FlutterConnection23
Adrien BODY
Staff Engineer Jocelyn GRISELLE
Software Engineer
Contractor
François NOLLEN
Staff Engineer
Dev Rel
🧠 YOUR 📱 👣 !
3
• Why
• Product & design
• Developer techniques
•
🔎
Tree Shaking
•
🔎
Eco-friendly mode
•
🔎
Deferred Components
• Testing & Monitoring
•
🔎
Green Tools
•
🔎
Tests
• Conclusion
WHY
4
Digital technologies cause
2.5% Carbon footprint
4% GHG emissions
(sources: ADEME/ARCEP 2023
+ The Shift Project 2019)
5
Source : ADEME / ARCEP
(March 2023)
6
Source : ADEME / ARCEP
(March 2023)
7
Source : ADEME / ARCEP
(March 2023)
PRODUCT & DESIGN
Doing the right thing 🎁
8
9
• Good product value 🌱
• Useful features 💡
• Efficient design / UX 💚
• Accessibility 🛟
PRODUCT & DESIGN MATTER
MOBILE DEVELOPMENT
Doing the thing right ♻
10
11
FOOTPRINT
♻
🔋
💚
🌱
DEVICE
12
⚡ CPU usage / FPS
🪫 Consuming hardware
(camera, sensors, gps)
📡 Network (caches, offline mode)
🗜 Size (payloads, assets, storage)
💡 Most of those techniques are
very well-documented
BASICS
13
TLDR; « Everything is not Black & White » 😉
• LCD vs. AMOLED
• « Dark » mode or « black » mode?
DARK MODES
Greenspector results (testing our own app):
• Dark blue theme on AMOLED: 3.0 g CO2
• Light theme on AMOLED: 3.9 g CO2
• Dark blue theme on LCD: 3.9 g CO2
• Light theme on LCD: 3.9 g CO2
Per year estimation (all shopping on dark blue mode):
• 22.5 M transactions on LCD + 7 M on AMOLED
• = 7 T of CO2 would be saved each year
14
A good thread strategy on a
multi-core CPU:
• Saves battery 🔋
• Optimizes UX 💚
💡 Threads can be optimized to run on a
separate core if available, a small or big
core when it’s an heavy task.
THREADS MATTER
Photo:
https://unsplash.com/fr/photos/NLgqFA9Lg_E
15
EG. HOW WE USE THREADS
• Main thread for simple UI and logic
• Isolates/Computes for complexe tasks
• Eg. deserializing with Compute (F) or Isolate.run (D) big payloads
• Eg. multiple requests in // with Isolate
• scheduleMicrotask
• Eg. network call needed for screen, prior to any other async Future
• workmanager for background native tasks
• Eg. Acknowledge notification in background
(⚠ Remember that Compute has a little boot overhead time)
16
REPAINT BOUNDARIES
• Separate widgets to subtrees at rendering level,
helping Flutter renderer know when repaint is needed
• Can optimize screens with many interactions
Photo:
https://unsplash.com/fr/photos/lvhu6dlFyLs
17
• Upgrading libs and
frameworks ASAP
• Leveraging new features
and improvements
…Including
⚡
and
🗜
!
STAYING UP-TO-DATE
STAYING UP-TO-DATE 👉 EXAMPLE
18
Before ⏳
(Skia only)
After ⚡ (Impeller)
(Emmanuel Lefebvre)
@ Flutter Paris, Jan’23
MOVING LOGIC TO THE BACK-END
19
• Presentation logic moved serverside:
• Presentation model / mapping
• Formatting, Localization
• Etc.
ü Consistency over multiple channels 🔐
ü Less code, fast redeploy, better TTM 🚀
ü Smaller frontend app(s) & less crashes 🌱
BFF server
(Back-For-Front)
Other channels
(eg. chatbots)
Mobile
Web
RESULTS: PAYLOAD AND MORE
20
[Ranking] Total payload on the network during navigation (source: Greenspector)
EXAMPLE: TRACKING & CONSENTS
21
S2S
tracking
vendors
BFF server
(Back-For-Front)
Other channels
(eg. chatbots)
Mobile
Web
• Server-to-server
tracking & consents
(☝GDPR)
• Frontend instrumentation
without 3rd-party SDKs
(RouteObserver,
consents listener)
Less 3rd-party SDKs in your app:
• Less CPU, less storage ⚡🗜🙂🌱
• Less integration issues or crashes 💣
22
📦 App Bundles
🌴 Tree Shaking
OPTIMIZING BUNDLES
Photo:
https://unsplash.com/fr/photos/r2jpr8MDw0I
ANDROID APP BUNDLES
23
• Android App Bundles
• Optimized bundles
for different devices
• In our case (average):
📉 -48% weight
OPTIMIZED BUNDLES FOR IOS?
24
• iOS build optimizations? No big difference measured so far with Flutter
• With iOS 14, the bitcode option has disappeared 🙁
• (Apple anticipating new homogeneous architecture?)
Source: https://www.emergetools.com/blog/posts/how-xcode14-unintentionally-increases-app-size
25
TREE SHAKING 🌴
Removes unused:
• Functions
• Fields
• Types
• Type params
• Type args
• Metadata
• Lib entries
• Classes
• Libs
Photo:
https://unsplash.com/fr/photos/DNkoNXQti3c
« LET’S SHAKE THE FLUTTER TREE »
26
Let’s Shake the Flutter Tree
(Aleksander Denisov)
@ Flutter Heroes ’23
TREE SHAKING IN PRACTICE
27
Use const at compile time (or conditional imports for Web)
1
VS.
2
28
• ⚠ Workspace: incorrect Android or Gradle files locations and non-necessary files get included into the bundle
• ⏳ Assets: not tree-shaked by default #64106
• ⏳ Conditional Imports: available only for the Web #23122
29
♻ Saving-energy mode
🪫 Low battery detected
🦕 Old device / low-end
device detected
CUSTOM ECO-MODE
30
🧑💻 UI thread &📱 Platform thread:
• More cache / longer TTL
• Disable secondary SDKs
• Avoid / Reduce precision
on geolocation
WHAT TO DISABLE / ADJUST
⚡ Raster thread:
• Disable transition animations
• Disable blend effects, opacity
• Disable clips, shadows
EXAMPLE
31
🤔 Disabling things from our onboarding wizard…
On a low-end device (2018):
- UX slightly degraded
ü FPS: +60 fps
ü CPU usage (average): 79% à 36%
👉 All about choices and balance
💚 No hardcore dev skills required
32
(and Dynamic Features)
DEFERRED COMPONENTS
Photo:
https://unsplash.com/fr/photos/gdL-UZfnD3I
EXAMPLE
33
💡 Defer the IDFM support in app?
• Public transportation for Paris only
• Buy dematerialized metro tickets
• Use your phone as a ticket
34
(Warning: a single missing import leads to no deferred lib)
1
2
DEFERRED COMPONENTS IN PRACTICE
DEFERRED COMPONENTS IN PRACTICE
35
pubspec.yaml
3
<meta-data
android:name="flu2erEmbedding"
android:value="2"/>
<meta-data
android:name="io.flu2er.embedding.engine.deferredcomponents.DeferredCom
ponentManager.loadingUnitMapping" android:value="2:idfm_sdk"/>
android:name="io.flu2er.embedding.android.Flu2erPlaySto
reSplitApplicaKon" Flu2erPlayStoreSplitApplicaKon()
or
4 5
36
37
BUILDING AND DEPLOYING
38
Photo:
https://unsplash.com/fr/photos/IEiAmhXehwE
39
HOW WE DEVELOP
MATTERS TOO
🧑💻 Work stations
(how many monitors do you use?... 🖥💻🖥)
🏭 Running environments, infrastructure,
integration pipelines, deployments…
40
⏳ Long-lived feature branches, running
envs/code waiting, the « 7 wastes of Lean »…
(prefer small increments & CD)
🚥 Backwards compatibility
(supporting old devices
👉
dedicated
tests/running environments?)
HOW WE DEVELOP
MATTERS TOO
TESTING & MONITORING ♻
41
GREENSPECTOR
42
(July 2022)
USER SCENARIO RANKING
85
Performance
(Elapsed Time)
117.5 s
Mobile Data
1.1 Mo
90
Energy
112.8 mAh
50
43
(Source: Greenspector 2022)
44
> MORE TOOLS
MONITORING TOOLS (EXAMPLES)
45
Sentry
ü « User Misery » Tools & Suspects
Datadog
ü CPU Usage
ü Memory Usage
ü FPS
Firebase
ü HTTP Latencies
ü App Start Time
46
> maestro test ./test_e2e/onboarding.yml
• Easy to write / run flows
• Based on real use cases
• Sometimes a bit flaky…
MAESTRO
FLASHLIGHT
47
• Performance stats
• Combines with your e2e tests nicely
• Can run/integrate with CI
• Iterations and retries
• Easy to compare runs
• (Only for Android)
48
INTEGRATION TESTS
CHROME TRACING / PERFETTO
49
GOLDEN TESTS FOR A11Y AND OLD DEVICES
50
ASSESSMENT MODELS
51
👉 https://ecoresponsable.numerique.gouv.fr
/publications/referentiel-general-ecoconception/
👉 https://myecodesignmaturity.eu/en.html
MESURE AND COMPARE 🌱 PERFORMANCE
52
Each feature
At least regularly
Many tools
available!
Monitoring
Tools
🌱 Crash
Analytics
Tools
Flutter
Debug Tools
Integ. Tests
+ Dedicated
Tools
Eco
Specialized
Tools
Assessment
Models
Golden
Tests
CONCLUSION
53
TAKEAWAYS
54
RESOURCES WE’VE SHARED (🇫🇷 / 🇬🇧)
55
E2E Testing with Flutter
Widget Testing with Flutter
Accessibility Testing with Flutter
Flutter @ Devoxx France
Flutter Heroes 2023
https://jobs.connect-tech.sncf/

More Related Content

PDF
OpenSource & InnerSource pour accélérer les développements
PDF
Dans le Monorepo vous n'êtes jamais seul, le Park est ouvert... 🦖🦕🐢 (@BreizhC...
PPTX
Devoxx 2018 : Chaos Engineering
PDF
Monorepo & Monomythe (@Volcamp 2023)
PDF
Introducing Clean Architecture
PPTX
Quand les neurosciences expliquent les bénéfices du Lean
PDF
Démystifions le Domain Driven Design
PDF
Design System as a Product
OpenSource & InnerSource pour accélérer les développements
Dans le Monorepo vous n'êtes jamais seul, le Park est ouvert... 🦖🦕🐢 (@BreizhC...
Devoxx 2018 : Chaos Engineering
Monorepo & Monomythe (@Volcamp 2023)
Introducing Clean Architecture
Quand les neurosciences expliquent les bénéfices du Lean
Démystifions le Domain Driven Design
Design System as a Product

What's hot (20)

PDF
From Paths to Sandboxes
PDF
実環境にTerraform導入したら驚いた
PDF
Mob Programming : How To Never Stop Producing Value - Scrum Gathering Talk 03...
PDF
Spring Initializrをハックする-カスタマイズを通してその内部実装を覗く
PPTX
SCS DevSecOps Seminar - State of DevSecOps
PDF
俺も エクストリームプログラミング入門
PDF
Agile Infrastructure - Agile 2009
PPTX
オーバーエンジニアリングって何? #devsumi #devsumiA
PDF
UX Fundamentals for Beginners
PDF
これからのJDK 何を選ぶ?どう選ぶ? (v1.2) in 熊本
PDF
Design Systems
PDF
實踐 Clean Architecture(實作高可用性的軟件架構)
PPTX
Domain Driven Design (DDD)
PDF
「黒騎士と白の魔王」gRPCによるHTTP/2 - API, Streamingの実践
PDF
【schoo WEB-campus】「頭を使う」ってどういうことだろう? 先生:細谷 功
PDF
Le Domain Driven Design, comment bien démarrer ?
PDF
Product Teams Need A Family Too! @ Iberia SWE Fest, Mar 2023
PDF
Why UX is Important
PDF
Creating and maintaining a design system for 130 teams - Bethany Sonefeld
PPTX
worker_threadsを使った実装の勘所
From Paths to Sandboxes
実環境にTerraform導入したら驚いた
Mob Programming : How To Never Stop Producing Value - Scrum Gathering Talk 03...
Spring Initializrをハックする-カスタマイズを通してその内部実装を覗く
SCS DevSecOps Seminar - State of DevSecOps
俺も エクストリームプログラミング入門
Agile Infrastructure - Agile 2009
オーバーエンジニアリングって何? #devsumi #devsumiA
UX Fundamentals for Beginners
これからのJDK 何を選ぶ?どう選ぶ? (v1.2) in 熊本
Design Systems
實踐 Clean Architecture(實作高可用性的軟件架構)
Domain Driven Design (DDD)
「黒騎士と白の魔王」gRPCによるHTTP/2 - API, Streamingの実践
【schoo WEB-campus】「頭を使う」ってどういうことだろう? 先生:細谷 功
Le Domain Driven Design, comment bien démarrer ?
Product Teams Need A Family Too! @ Iberia SWE Fest, Mar 2023
Why UX is Important
Creating and maintaining a design system for 130 teams - Bethany Sonefeld
worker_threadsを使った実装の勘所
Ad

Similar to Mind your App Footprint 🐾⚡️🌱 (@FlutterConn 2023) (20)

PDF
Mind your App Footprint 🐾⚡️🌱 (@FlutterHeroes 2024)
PDF
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)
PDF
Big Trouble in Little Networks, new and improved
PDF
Ecological Impact of Native vs. Cross-Platform Mobile Apps: a Preliminary Study
PPTX
Flutter technology Based on Web Development
PPTX
Chapter One - Introduction to Mobile Oses
PPTX
Chapter One - Introduction to Mobile Oses
PPTX
Flutter vs ReactNative
PDF
Dart Lecture Slides for Beginner level to Pro
PDF
Tech winter break - GDG on campus PPT1.pptx.pdf
PDF
LAP II - Lezione 01 Introduzione al corso
PDF
Flutter vs React Native
PDF
Presentazione Corso LAP 2 A.A. 2016/2017
PDF
Flutter vs React native vs Native performance.pdf
PPTX
Google I/O 2018 Extended, Baghdad - Flutter
PDF
Flutter App Development Company
PDF
TK2323 Lecture 1 - Introduction to Mobile Application.pdf
PDF
New Flutter 3.7 Release Guide
PPTX
From React to React Native - Things I wish I knew when I started
PDF
Choose between flutter and react native
Mind your App Footprint 🐾⚡️🌱 (@FlutterHeroes 2024)
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)
Big Trouble in Little Networks, new and improved
Ecological Impact of Native vs. Cross-Platform Mobile Apps: a Preliminary Study
Flutter technology Based on Web Development
Chapter One - Introduction to Mobile Oses
Chapter One - Introduction to Mobile Oses
Flutter vs ReactNative
Dart Lecture Slides for Beginner level to Pro
Tech winter break - GDG on campus PPT1.pptx.pdf
LAP II - Lezione 01 Introduzione al corso
Flutter vs React Native
Presentazione Corso LAP 2 A.A. 2016/2017
Flutter vs React native vs Native performance.pdf
Google I/O 2018 Extended, Baghdad - Flutter
Flutter App Development Company
TK2323 Lecture 1 - Introduction to Mobile Application.pdf
New Flutter 3.7 Release Guide
From React to React Native - Things I wish I knew when I started
Choose between flutter and react native
Ad

More from François (14)

PDF
A la recherche du RAG perdu 🤠🧭🤖 (@DevoxxFR 2025)
PDF
B.O.F. communauté InnerSource (@DevoxxFR 2025)
PDF
A Journey to Continuous Delivery with Flutter ⚡️🚀🙂 (@Flutter_Connect 2025)
PDF
A Journey to Continuous Delivery with Flutter ⚡️🚀🙂 (@FlutterHeroes 2025)
PDF
TOSIT.fr grandes organisations & open source (@OSXP_Paris 2024)
PDF
RAG against the Machine 😎🤖 (@DevFestNantes 2024)
PDF
C'est une bonne situation ça, Staff Engineer ? 😉 (@DevoxxFR 2024)
PDF
Collecte unifiée Server-to-Server - Tealium SNCF Connect (@EBG 2023)
PDF
REX Flutter SNCF Connect (@VivaTech 2022).pdf
PDF
Tock & Mélusine REX IA Open Source #AIParis 2020
PDF
Conversational AI & Open Source #OSSPARIS19
PPTX
TOCK (The Open Conversation Kit) @ Meetup Open Transport
PDF
Monitoring une recette DevOps
PDF
DevOps et tendances Monitoring
A la recherche du RAG perdu 🤠🧭🤖 (@DevoxxFR 2025)
B.O.F. communauté InnerSource (@DevoxxFR 2025)
A Journey to Continuous Delivery with Flutter ⚡️🚀🙂 (@Flutter_Connect 2025)
A Journey to Continuous Delivery with Flutter ⚡️🚀🙂 (@FlutterHeroes 2025)
TOSIT.fr grandes organisations & open source (@OSXP_Paris 2024)
RAG against the Machine 😎🤖 (@DevFestNantes 2024)
C'est une bonne situation ça, Staff Engineer ? 😉 (@DevoxxFR 2024)
Collecte unifiée Server-to-Server - Tealium SNCF Connect (@EBG 2023)
REX Flutter SNCF Connect (@VivaTech 2022).pdf
Tock & Mélusine REX IA Open Source #AIParis 2020
Conversational AI & Open Source #OSSPARIS19
TOCK (The Open Conversation Kit) @ Meetup Open Transport
Monitoring une recette DevOps
DevOps et tendances Monitoring

Recently uploaded (20)

PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Tartificialntelligence_presentation.pptx
PDF
Encapsulation theory and applications.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
Approach and Philosophy of On baking technology
PDF
Mushroom cultivation and it's methods.pdf
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Getting Started with Data Integration: FME Form 101
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
A Presentation on Touch Screen Technology
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
Chapter 5: Probability Theory and Statistics
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
A novel scalable deep ensemble learning framework for big data classification...
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Tartificialntelligence_presentation.pptx
Encapsulation theory and applications.pdf
Programs and apps: productivity, graphics, security and other tools
WOOl fibre morphology and structure.pdf for textiles
Approach and Philosophy of On baking technology
Mushroom cultivation and it's methods.pdf
1 - Historical Antecedents, Social Consideration.pdf
Web App vs Mobile App What Should You Build First.pdf
NewMind AI Weekly Chronicles - August'25-Week II
Getting Started with Data Integration: FME Form 101
SOPHOS-XG Firewall Administrator PPT.pptx
A Presentation on Touch Screen Technology
Zenith AI: Advanced Artificial Intelligence
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
cloud_computing_Infrastucture_as_cloud_p
Chapter 5: Probability Theory and Statistics
A comparative analysis of optical character recognition models for extracting...
A novel scalable deep ensemble learning framework for big data classification...

Mind your App Footprint 🐾⚡️🌱 (@FlutterConn 2023)

  • 1. 1 MIND YOUR APP FOOTPRINT! 🐾⚡🌱 How to Test & Reduce your Mobile App Footprint #FlutterConnection23
  • 2. Adrien BODY Staff Engineer Jocelyn GRISELLE Software Engineer Contractor François NOLLEN Staff Engineer Dev Rel
  • 3. 🧠 YOUR 📱 👣 ! 3 • Why • Product & design • Developer techniques • 🔎 Tree Shaking • 🔎 Eco-friendly mode • 🔎 Deferred Components • Testing & Monitoring • 🔎 Green Tools • 🔎 Tests • Conclusion
  • 4. WHY 4 Digital technologies cause 2.5% Carbon footprint 4% GHG emissions (sources: ADEME/ARCEP 2023 + The Shift Project 2019)
  • 5. 5 Source : ADEME / ARCEP (March 2023)
  • 6. 6 Source : ADEME / ARCEP (March 2023)
  • 7. 7 Source : ADEME / ARCEP (March 2023)
  • 8. PRODUCT & DESIGN Doing the right thing 🎁 8
  • 9. 9 • Good product value 🌱 • Useful features 💡 • Efficient design / UX 💚 • Accessibility 🛟 PRODUCT & DESIGN MATTER
  • 10. MOBILE DEVELOPMENT Doing the thing right ♻ 10
  • 12. 12 ⚡ CPU usage / FPS 🪫 Consuming hardware (camera, sensors, gps) 📡 Network (caches, offline mode) 🗜 Size (payloads, assets, storage) 💡 Most of those techniques are very well-documented BASICS
  • 13. 13 TLDR; « Everything is not Black & White » 😉 • LCD vs. AMOLED • « Dark » mode or « black » mode? DARK MODES Greenspector results (testing our own app): • Dark blue theme on AMOLED: 3.0 g CO2 • Light theme on AMOLED: 3.9 g CO2 • Dark blue theme on LCD: 3.9 g CO2 • Light theme on LCD: 3.9 g CO2 Per year estimation (all shopping on dark blue mode): • 22.5 M transactions on LCD + 7 M on AMOLED • = 7 T of CO2 would be saved each year
  • 14. 14 A good thread strategy on a multi-core CPU: • Saves battery 🔋 • Optimizes UX 💚 💡 Threads can be optimized to run on a separate core if available, a small or big core when it’s an heavy task. THREADS MATTER Photo: https://unsplash.com/fr/photos/NLgqFA9Lg_E
  • 15. 15 EG. HOW WE USE THREADS • Main thread for simple UI and logic • Isolates/Computes for complexe tasks • Eg. deserializing with Compute (F) or Isolate.run (D) big payloads • Eg. multiple requests in // with Isolate • scheduleMicrotask • Eg. network call needed for screen, prior to any other async Future • workmanager for background native tasks • Eg. Acknowledge notification in background (⚠ Remember that Compute has a little boot overhead time)
  • 16. 16 REPAINT BOUNDARIES • Separate widgets to subtrees at rendering level, helping Flutter renderer know when repaint is needed • Can optimize screens with many interactions Photo: https://unsplash.com/fr/photos/lvhu6dlFyLs
  • 17. 17 • Upgrading libs and frameworks ASAP • Leveraging new features and improvements …Including ⚡ and 🗜 ! STAYING UP-TO-DATE
  • 18. STAYING UP-TO-DATE 👉 EXAMPLE 18 Before ⏳ (Skia only) After ⚡ (Impeller) (Emmanuel Lefebvre) @ Flutter Paris, Jan’23
  • 19. MOVING LOGIC TO THE BACK-END 19 • Presentation logic moved serverside: • Presentation model / mapping • Formatting, Localization • Etc. ü Consistency over multiple channels 🔐 ü Less code, fast redeploy, better TTM 🚀 ü Smaller frontend app(s) & less crashes 🌱 BFF server (Back-For-Front) Other channels (eg. chatbots) Mobile Web
  • 20. RESULTS: PAYLOAD AND MORE 20 [Ranking] Total payload on the network during navigation (source: Greenspector)
  • 21. EXAMPLE: TRACKING & CONSENTS 21 S2S tracking vendors BFF server (Back-For-Front) Other channels (eg. chatbots) Mobile Web • Server-to-server tracking & consents (☝GDPR) • Frontend instrumentation without 3rd-party SDKs (RouteObserver, consents listener) Less 3rd-party SDKs in your app: • Less CPU, less storage ⚡🗜🙂🌱 • Less integration issues or crashes 💣
  • 22. 22 📦 App Bundles 🌴 Tree Shaking OPTIMIZING BUNDLES Photo: https://unsplash.com/fr/photos/r2jpr8MDw0I
  • 23. ANDROID APP BUNDLES 23 • Android App Bundles • Optimized bundles for different devices • In our case (average): 📉 -48% weight
  • 24. OPTIMIZED BUNDLES FOR IOS? 24 • iOS build optimizations? No big difference measured so far with Flutter • With iOS 14, the bitcode option has disappeared 🙁 • (Apple anticipating new homogeneous architecture?) Source: https://www.emergetools.com/blog/posts/how-xcode14-unintentionally-increases-app-size
  • 25. 25 TREE SHAKING 🌴 Removes unused: • Functions • Fields • Types • Type params • Type args • Metadata • Lib entries • Classes • Libs Photo: https://unsplash.com/fr/photos/DNkoNXQti3c
  • 26. « LET’S SHAKE THE FLUTTER TREE » 26 Let’s Shake the Flutter Tree (Aleksander Denisov) @ Flutter Heroes ’23
  • 27. TREE SHAKING IN PRACTICE 27 Use const at compile time (or conditional imports for Web) 1 VS. 2
  • 28. 28 • ⚠ Workspace: incorrect Android or Gradle files locations and non-necessary files get included into the bundle • ⏳ Assets: not tree-shaked by default #64106 • ⏳ Conditional Imports: available only for the Web #23122
  • 29. 29 ♻ Saving-energy mode 🪫 Low battery detected 🦕 Old device / low-end device detected CUSTOM ECO-MODE
  • 30. 30 🧑💻 UI thread &📱 Platform thread: • More cache / longer TTL • Disable secondary SDKs • Avoid / Reduce precision on geolocation WHAT TO DISABLE / ADJUST ⚡ Raster thread: • Disable transition animations • Disable blend effects, opacity • Disable clips, shadows
  • 31. EXAMPLE 31 🤔 Disabling things from our onboarding wizard… On a low-end device (2018): - UX slightly degraded ü FPS: +60 fps ü CPU usage (average): 79% à 36% 👉 All about choices and balance 💚 No hardcore dev skills required
  • 32. 32 (and Dynamic Features) DEFERRED COMPONENTS Photo: https://unsplash.com/fr/photos/gdL-UZfnD3I
  • 33. EXAMPLE 33 💡 Defer the IDFM support in app? • Public transportation for Paris only • Buy dematerialized metro tickets • Use your phone as a ticket
  • 34. 34 (Warning: a single missing import leads to no deferred lib) 1 2 DEFERRED COMPONENTS IN PRACTICE
  • 35. DEFERRED COMPONENTS IN PRACTICE 35 pubspec.yaml 3 <meta-data android:name="flu2erEmbedding" android:value="2"/> <meta-data android:name="io.flu2er.embedding.engine.deferredcomponents.DeferredCom ponentManager.loadingUnitMapping" android:value="2:idfm_sdk"/> android:name="io.flu2er.embedding.android.Flu2erPlaySto reSplitApplicaKon" Flu2erPlayStoreSplitApplicaKon() or 4 5
  • 36. 36
  • 37. 37
  • 39. 39 HOW WE DEVELOP MATTERS TOO 🧑💻 Work stations (how many monitors do you use?... 🖥💻🖥) 🏭 Running environments, infrastructure, integration pipelines, deployments…
  • 40. 40 ⏳ Long-lived feature branches, running envs/code waiting, the « 7 wastes of Lean »… (prefer small increments & CD) 🚥 Backwards compatibility (supporting old devices 👉 dedicated tests/running environments?) HOW WE DEVELOP MATTERS TOO
  • 43. USER SCENARIO RANKING 85 Performance (Elapsed Time) 117.5 s Mobile Data 1.1 Mo 90 Energy 112.8 mAh 50 43 (Source: Greenspector 2022)
  • 45. MONITORING TOOLS (EXAMPLES) 45 Sentry ü « User Misery » Tools & Suspects Datadog ü CPU Usage ü Memory Usage ü FPS Firebase ü HTTP Latencies ü App Start Time
  • 46. 46 > maestro test ./test_e2e/onboarding.yml • Easy to write / run flows • Based on real use cases • Sometimes a bit flaky… MAESTRO
  • 47. FLASHLIGHT 47 • Performance stats • Combines with your e2e tests nicely • Can run/integrate with CI • Iterations and retries • Easy to compare runs • (Only for Android)
  • 49. CHROME TRACING / PERFETTO 49
  • 50. GOLDEN TESTS FOR A11Y AND OLD DEVICES 50
  • 52. MESURE AND COMPARE 🌱 PERFORMANCE 52 Each feature At least regularly Many tools available! Monitoring Tools 🌱 Crash Analytics Tools Flutter Debug Tools Integ. Tests + Dedicated Tools Eco Specialized Tools Assessment Models Golden Tests
  • 55. RESOURCES WE’VE SHARED (🇫🇷 / 🇬🇧) 55 E2E Testing with Flutter Widget Testing with Flutter Accessibility Testing with Flutter Flutter @ Devoxx France Flutter Heroes 2023