SlideShare a Scribd company logo
1 of 48
MIND YOUR APP FOOTPRINT! 🐾⚡🌱
How to Reduce your Mobile App Footprint
#FlutterHeroes24
Alexandre POICHET
Software Engineer Alexis CHOUPAULT
Software Engineer
François NOLLEN
Staff Engineer
Dev Rel
🧠 YOUR 📱 👣 !
• Why
• Product & design
• Developer techniques
•
🔎
Basics
•
🔎
Bundles
•
🔎
On-demand
•
🔎
DIY
• Testing & Monitoring
• 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
8
Building the right thing 🌱
DOING THE RIGHT THING?
9
Finding a GOOD DEAL…
• More engaged with final users
• More compliant with environment
ENVIRONMENT
• Efficient Design
• Accessibility
FEATURES
• Useful Features
QUALITY
• Good product value
• Small bugs
Where is the Green 🌱 part?
10
EX. WE SPOT TURTLES! 🌊🐢🌏
#WeArePlay
We Spot Turtles! | Australia
(Nicolas Guillot &
Caitlin McKeown)
11
♻ Retro-compatibility is crucial!
🐾 …yet it has a cost / footprint (tests, payloads, envs…)
👀 Monitor your app & user behaviours
🧹 Clean-up payloads when possible
🗑 Drop unused versions
EX. BACKWARD COMPATIBILITY
Version N-1
0,00% users
Version N
x,xx% users
👇
12
♻ Unused features
📵 Deprecated versions
🎛 Complexity
🐾 Footprint
FUNCTIONAL DEBT / WASTE
« Less…
…is more »
🛟 Accessibility
❤ User experience
💸 Product & business value
MOBILE DEVELOPMENT
Doing the thing right ♻
13
14
⚡ 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
♻
🔋
💚
🌱
15
• Display technologies : LCD vs. AMOLED
• « Dark » mode or « black » mode?
DARK MODES
Our app results LCD AMOLED
Light theme 3,9 g CO2 3,9 g CO2
Dark blue theme 3,9 g CO2 3.0 g CO2 (-23%)
TLDR; « Not everything is Black & White » 😉
(Source: )
16
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
17
• Upgrading libs and
frameworks ASAP
• Leveraging new features
and improvements
…Including
⚡
and
🗜
!
STAYING UP-TO-DATE
EXAMPLE 👉 IMPELLER
18
Before ⏳
(Skia only)
After ⚡ (Impeller)
(Emmanuel Lefebvre)
@ Flutter Paris, Jan’23
19
REPAINT BOUNDARIES
• Separate widgets to subtrees at rendering level,
helps Flutter renderer know when repaint is needed
• Can optimize screens with many interactions
MOVING LOGIC TO THE BACK-END
20
• Pattern: 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
21
Data exchanged on
the network (ko)
[Ranking] Total payload on the network during navigation (source: )
EXAMPLE: TRACKING & CONSENTS
22
S2S
tracking
vendors
BFF server
(Back-For-Front)
Other channels
(eg. chatbots)
Mobile
Web
• Server-to-server
tracking & consents
(☝GDPR)
• Custom frontend
instrumentation
(RouteObserver,
EventListener)
• Most logic, data
and impacts
moved to the back-end
Removing 90% of
3rd-party SDKs from
the frontend:
• Less CPU, less
storage, smaller
footprint ⚡🗜🌱
• Less integration
issues or crashes 💣
• Better UX 🙂
23
📦 App Bundles
🌴 Tree Shaking
OPTIMIZING BUNDLES
« App size is one of the biggest factors […]. It’s
important to regularly monitor and understand
how you can reduce your app’s download and
install sizes. »
Google Play Console Documentation
ANDROID APP BUNDLES
24
• Android App Bundles
• Optimized bundles
for different devices
• In our case (average):
📉 -48% weight
OPTIMIZED BUNDLES FOR IOS
25
🗜 App Thinning
🗑 Unused Code and Resources
♻ Swift Language Features
Available techniques 👉 refer to documentation
26
TREE SHAKING 🌴
Removes unused:
• Functions
• Fields
• Types
• Type params
• Type args
• Metadata
• Lib entries
• Classes
• Libs
TREE SHAKING IN PRACTICE
27
Use const at compile time (or conditional imports for Web)
1
VS.
2
Let’s Shake the Flutter Tree
(Aleksander Denisov) @ Flutter Heroes ’23
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
DEFERRED COMPONENTS
💤 Lazy loading at runtime
📲 On-demand features
🗜 Save phone storage
🐾 Reduce memory footprint
(based on Android Dynamic Features )
💡 Lazy loading gracely replaced by eager
loading on platforms, not compatible (eg. iOS)
EXAMPLE
30
💡 Defer the IDFM support in app?
Public transportation for Paris only
(ie. buy dematerialized metro tickets
+ use your phone as a ticket )
31
(Warning: a single missing import leads to no deferred lib)
1
2
DEFERRED COMPONENTS IN PRACTICE
32
pubspec.yaml
3
<meta-data
android:name="flu1erEmbedding"
android:value="2"/>
<meta-data
android:name="io.flu1er.embedding.engine.deferredcomponents.DeferredCom
ponentManager.loadingUnitMapping" android:value="2:idfm_sdk"/>
android:name="io.flu1er.embedding.android.Flu1erPlaySto
reSplitApplicaKon" Flu1erPlayStoreSplitApplicaKon()
or
4 5
DEFERRED COMPONENTS IN PRACTICE
33
DEFERRED COMPONENTS IN PRACTICE
34
♻ Saving-energy mode?
🪫 Low battery detected?
🦕 Old device / low-end
device detected?
💡 DIY: adjust your app
footprint on-the-fly!
CUSTOM ECO-MODE
35
🧑💻 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
36
🤔 Disabling things from our onboarding wizard…
On a low-end device (2018):
- UI/accuracy slightly degraded
ü FPS: +60 fps
ü CPU usage (average): 79% à 36%
👉 All about choices and balance
💚 No hardcore dev skills required
FLUTTER_ECO_MODE PLUGIN
37
38
Concevoir des paramètres
écologiques dans les
applications 🇫🇷
@ Mobilis In Mobile 2023
(Thomas Thibault)
DESIGNING « ECO-FRIENDLY » USER PARAMS & OPTIONS
TESTING & MONITORING ♻
39
RUNTIME ANALYSIS (EX. GREENSPECTOR)
85
Performance
(Elapsed Time)
117.5 s
Mobile Data
1.1 Mo
90
Energy
112.8 mAh
50
40
(Source: Greenspector 2022)
41
STATIC ANALYSIS (EX. ECOCODE)
« Flutter Community,
We need to build
Flutter/Dart Eco Rules! »
https://ecocode.io
FLASHLIGHT « LIGHTHOUSE FOR MOBILE »
42
• Includes retries and iterations
• Combines nicely with your e2e tests
• Easy to compare runs
• Video recording
• Android only
https://docs.flashlight.dev/
43
INTEGRATION TESTS (WITH CHROME TRACING / PERFETTO)
GOLDEN TESTS
44
How does your
App render on
a small screen?
✅
CONCLUSION
45
46
Many ways to reduce your app footprint,
optimize and reduce the waste ♻
Test and monitor your app performance
over time, many tools are available 🔍
Solutions we all know, others few of us know.
Learn, use, share your techniques 🌱
RESOURCES WE’VE SHARED (🇫🇷 / 🇬🇧)
47
E2E Testing with Flutter
Widget Testing with Flutter
Accessibility Testing with Flutter
Flutter @ Devoxx France
Flutter Heroes 2023
Flutter Connection 2023
https://jobs.connect-tech.sncf/

More Related Content

Similar to Mind your App Footprint 🐾⚡️🌱 (@FlutterHeroes 2024)

Engage 2018 - What About the Apps? A Domino Modernisation Story
Engage 2018 - What About the Apps? A Domino Modernisation StoryEngage 2018 - What About the Apps? A Domino Modernisation Story
Engage 2018 - What About the Apps? A Domino Modernisation StoryJared Roberts
 
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...Fabrice Bernhard
 
Leveraging Open Standards to Build Highly Extensible Autonomous Systems
Leveraging Open Standards to Build Highly Extensible Autonomous SystemsLeveraging Open Standards to Build Highly Extensible Autonomous Systems
Leveraging Open Standards to Build Highly Extensible Autonomous SystemsICS
 
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...Demi Ben-Ari
 
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...Henning Jacobs
 
Developer Experience at Zalando - Handelsblatt Strategisches IT-Management 2019
Developer Experience at Zalando - Handelsblatt Strategisches IT-Management 2019Developer Experience at Zalando - Handelsblatt Strategisches IT-Management 2019
Developer Experience at Zalando - Handelsblatt Strategisches IT-Management 2019Henning Jacobs
 
Efficient platform engineering with Microk8s & gopaddle.pdf
Efficient platform engineering  with  Microk8s & gopaddle.pdfEfficient platform engineering  with  Microk8s & gopaddle.pdf
Efficient platform engineering with Microk8s & gopaddle.pdfVinothini Raju
 
Cloud-Native & Sustainability: How and Why to Build Sustainable Workloads
Cloud-Native & Sustainability: How and Why to Build Sustainable WorkloadsCloud-Native & Sustainability: How and Why to Build Sustainable Workloads
Cloud-Native & Sustainability: How and Why to Build Sustainable WorkloadsNico Meisenzahl
 
AWS re:Invent 2016: Hardware-Accelerating Graphics Desktop Workloads with Ama...
AWS re:Invent 2016: Hardware-Accelerating Graphics Desktop Workloads with Ama...AWS re:Invent 2016: Hardware-Accelerating Graphics Desktop Workloads with Ama...
AWS re:Invent 2016: Hardware-Accelerating Graphics Desktop Workloads with Ama...Amazon Web Services
 
Android Overview
Android OverviewAndroid Overview
Android Overviewatomi
 
Slow, Flaky and Legacy Tests: FTFY - Our New Testing Strategy at Net-A-Porter...
Slow, Flaky and Legacy Tests: FTFY - Our New Testing Strategy at Net-A-Porter...Slow, Flaky and Legacy Tests: FTFY - Our New Testing Strategy at Net-A-Porter...
Slow, Flaky and Legacy Tests: FTFY - Our New Testing Strategy at Net-A-Porter...Sauce Labs
 
Deep Dive into the Idea of Software Architecture
Deep Dive into the Idea of Software ArchitectureDeep Dive into the Idea of Software Architecture
Deep Dive into the Idea of Software ArchitectureMatthew Clarke
 
Docker Enterprise Workshop - Intro
Docker Enterprise Workshop - IntroDocker Enterprise Workshop - Intro
Docker Enterprise Workshop - IntroPatrick Chanezon
 
Introducción a Docker - LibreCon 2016
Introducción a Docker - LibreCon 2016Introducción a Docker - LibreCon 2016
Introducción a Docker - LibreCon 2016LibreCon
 
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...Embarcados
 
Clean low-code - OutSystens
Clean low-code - OutSystensClean low-code - OutSystens
Clean low-code - OutSystensHasan Derawan
 
Tools and best practices for sustainable software
Tools and best practices for sustainable softwareTools and best practices for sustainable software
Tools and best practices for sustainable softwareGreen Software Development
 
Tools and best practices for sustainable software.pdf
Tools and best practices for sustainable software.pdfTools and best practices for sustainable software.pdf
Tools and best practices for sustainable software.pdfGeorgMolz
 

Similar to Mind your App Footprint 🐾⚡️🌱 (@FlutterHeroes 2024) (20)

Engage 2018 - What About the Apps? A Domino Modernisation Story
Engage 2018 - What About the Apps? A Domino Modernisation StoryEngage 2018 - What About the Apps? A Domino Modernisation Story
Engage 2018 - What About the Apps? A Domino Modernisation Story
 
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
 
Leveraging Open Standards to Build Highly Extensible Autonomous Systems
Leveraging Open Standards to Build Highly Extensible Autonomous SystemsLeveraging Open Standards to Build Highly Extensible Autonomous Systems
Leveraging Open Standards to Build Highly Extensible Autonomous Systems
 
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
 
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
 
The road to green code
The road to green codeThe road to green code
The road to green code
 
DevOps & SRE at Google Scale
DevOps & SRE at Google ScaleDevOps & SRE at Google Scale
DevOps & SRE at Google Scale
 
Developer Experience at Zalando - Handelsblatt Strategisches IT-Management 2019
Developer Experience at Zalando - Handelsblatt Strategisches IT-Management 2019Developer Experience at Zalando - Handelsblatt Strategisches IT-Management 2019
Developer Experience at Zalando - Handelsblatt Strategisches IT-Management 2019
 
Efficient platform engineering with Microk8s & gopaddle.pdf
Efficient platform engineering  with  Microk8s & gopaddle.pdfEfficient platform engineering  with  Microk8s & gopaddle.pdf
Efficient platform engineering with Microk8s & gopaddle.pdf
 
Cloud-Native & Sustainability: How and Why to Build Sustainable Workloads
Cloud-Native & Sustainability: How and Why to Build Sustainable WorkloadsCloud-Native & Sustainability: How and Why to Build Sustainable Workloads
Cloud-Native & Sustainability: How and Why to Build Sustainable Workloads
 
AWS re:Invent 2016: Hardware-Accelerating Graphics Desktop Workloads with Ama...
AWS re:Invent 2016: Hardware-Accelerating Graphics Desktop Workloads with Ama...AWS re:Invent 2016: Hardware-Accelerating Graphics Desktop Workloads with Ama...
AWS re:Invent 2016: Hardware-Accelerating Graphics Desktop Workloads with Ama...
 
Android Overview
Android OverviewAndroid Overview
Android Overview
 
Slow, Flaky and Legacy Tests: FTFY - Our New Testing Strategy at Net-A-Porter...
Slow, Flaky and Legacy Tests: FTFY - Our New Testing Strategy at Net-A-Porter...Slow, Flaky and Legacy Tests: FTFY - Our New Testing Strategy at Net-A-Porter...
Slow, Flaky and Legacy Tests: FTFY - Our New Testing Strategy at Net-A-Porter...
 
Deep Dive into the Idea of Software Architecture
Deep Dive into the Idea of Software ArchitectureDeep Dive into the Idea of Software Architecture
Deep Dive into the Idea of Software Architecture
 
Docker Enterprise Workshop - Intro
Docker Enterprise Workshop - IntroDocker Enterprise Workshop - Intro
Docker Enterprise Workshop - Intro
 
Introducción a Docker - LibreCon 2016
Introducción a Docker - LibreCon 2016Introducción a Docker - LibreCon 2016
Introducción a Docker - LibreCon 2016
 
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
 
Clean low-code - OutSystens
Clean low-code - OutSystensClean low-code - OutSystens
Clean low-code - OutSystens
 
Tools and best practices for sustainable software
Tools and best practices for sustainable softwareTools and best practices for sustainable software
Tools and best practices for sustainable software
 
Tools and best practices for sustainable software.pdf
Tools and best practices for sustainable software.pdfTools and best practices for sustainable software.pdf
Tools and best practices for sustainable software.pdf
 

More from François

C'est une bonne situation ça, Staff Engineer ? 😉 (@DevoxxFR 2024)
C'est une bonne situation ça, Staff Engineer ? 😉 (@DevoxxFR 2024)C'est une bonne situation ça, Staff Engineer ? 😉 (@DevoxxFR 2024)
C'est une bonne situation ça, Staff Engineer ? 😉 (@DevoxxFR 2024)François
 
Monorepo & Monomythe (@Volcamp 2023)
Monorepo & Monomythe (@Volcamp 2023)Monorepo & Monomythe (@Volcamp 2023)
Monorepo & Monomythe (@Volcamp 2023)François
 
Collecte unifiée Server-to-Server - Tealium SNCF Connect (@EBG 2023)
Collecte unifiée Server-to-Server - Tealium SNCF Connect (@EBG 2023)Collecte unifiée Server-to-Server - Tealium SNCF Connect (@EBG 2023)
Collecte unifiée Server-to-Server - Tealium SNCF Connect (@EBG 2023)François
 
REX Flutter SNCF Connect (@VivaTech 2022).pdf
REX Flutter SNCF Connect (@VivaTech 2022).pdfREX Flutter SNCF Connect (@VivaTech 2022).pdf
REX Flutter SNCF Connect (@VivaTech 2022).pdfFrançois
 
OpenSource & InnerSource pour accélérer les développements
OpenSource & InnerSource pour accélérer les développementsOpenSource & InnerSource pour accélérer les développements
OpenSource & InnerSource pour accélérer les développementsFrançois
 
Dans le Monorepo vous n'êtes jamais seul, le Park est ouvert... 🦖🦕🐢 (@BreizhC...
Dans le Monorepo vous n'êtes jamais seul, le Park est ouvert... 🦖🦕🐢 (@BreizhC...Dans le Monorepo vous n'êtes jamais seul, le Park est ouvert... 🦖🦕🐢 (@BreizhC...
Dans le Monorepo vous n'êtes jamais seul, le Park est ouvert... 🦖🦕🐢 (@BreizhC...François
 
Tock & Mélusine REX IA Open Source #AIParis 2020
Tock & Mélusine REX IA Open Source #AIParis 2020Tock & Mélusine REX IA Open Source #AIParis 2020
Tock & Mélusine REX IA Open Source #AIParis 2020François
 
Conversational AI & Open Source #OSSPARIS19
Conversational AI & Open Source #OSSPARIS19Conversational AI & Open Source #OSSPARIS19
Conversational AI & Open Source #OSSPARIS19François
 
TOCK (The Open Conversation Kit) @ Meetup Open Transport
TOCK (The Open Conversation Kit) @ Meetup Open TransportTOCK (The Open Conversation Kit) @ Meetup Open Transport
TOCK (The Open Conversation Kit) @ Meetup Open TransportFrançois
 
Monitoring une recette DevOps
Monitoring une recette DevOpsMonitoring une recette DevOps
Monitoring une recette DevOpsFrançois
 
DevOps et tendances Monitoring
DevOps et tendances MonitoringDevOps et tendances Monitoring
DevOps et tendances MonitoringFrançois
 

More from François (11)

C'est une bonne situation ça, Staff Engineer ? 😉 (@DevoxxFR 2024)
C'est une bonne situation ça, Staff Engineer ? 😉 (@DevoxxFR 2024)C'est une bonne situation ça, Staff Engineer ? 😉 (@DevoxxFR 2024)
C'est une bonne situation ça, Staff Engineer ? 😉 (@DevoxxFR 2024)
 
Monorepo & Monomythe (@Volcamp 2023)
Monorepo & Monomythe (@Volcamp 2023)Monorepo & Monomythe (@Volcamp 2023)
Monorepo & Monomythe (@Volcamp 2023)
 
Collecte unifiée Server-to-Server - Tealium SNCF Connect (@EBG 2023)
Collecte unifiée Server-to-Server - Tealium SNCF Connect (@EBG 2023)Collecte unifiée Server-to-Server - Tealium SNCF Connect (@EBG 2023)
Collecte unifiée Server-to-Server - Tealium SNCF Connect (@EBG 2023)
 
REX Flutter SNCF Connect (@VivaTech 2022).pdf
REX Flutter SNCF Connect (@VivaTech 2022).pdfREX Flutter SNCF Connect (@VivaTech 2022).pdf
REX Flutter SNCF Connect (@VivaTech 2022).pdf
 
OpenSource & InnerSource pour accélérer les développements
OpenSource & InnerSource pour accélérer les développementsOpenSource & InnerSource pour accélérer les développements
OpenSource & InnerSource pour accélérer les développements
 
Dans le Monorepo vous n'êtes jamais seul, le Park est ouvert... 🦖🦕🐢 (@BreizhC...
Dans le Monorepo vous n'êtes jamais seul, le Park est ouvert... 🦖🦕🐢 (@BreizhC...Dans le Monorepo vous n'êtes jamais seul, le Park est ouvert... 🦖🦕🐢 (@BreizhC...
Dans le Monorepo vous n'êtes jamais seul, le Park est ouvert... 🦖🦕🐢 (@BreizhC...
 
Tock & Mélusine REX IA Open Source #AIParis 2020
Tock & Mélusine REX IA Open Source #AIParis 2020Tock & Mélusine REX IA Open Source #AIParis 2020
Tock & Mélusine REX IA Open Source #AIParis 2020
 
Conversational AI & Open Source #OSSPARIS19
Conversational AI & Open Source #OSSPARIS19Conversational AI & Open Source #OSSPARIS19
Conversational AI & Open Source #OSSPARIS19
 
TOCK (The Open Conversation Kit) @ Meetup Open Transport
TOCK (The Open Conversation Kit) @ Meetup Open TransportTOCK (The Open Conversation Kit) @ Meetup Open Transport
TOCK (The Open Conversation Kit) @ Meetup Open Transport
 
Monitoring une recette DevOps
Monitoring une recette DevOpsMonitoring une recette DevOps
Monitoring une recette DevOps
 
DevOps et tendances Monitoring
DevOps et tendances MonitoringDevOps et tendances Monitoring
DevOps et tendances Monitoring
 

Recently uploaded

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Hiroshi SHIBATA
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...ScyllaDB
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPTiSEO AI
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...FIDO Alliance
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?Paolo Missier
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 

Recently uploaded (20)

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 

Mind your App Footprint 🐾⚡️🌱 (@FlutterHeroes 2024)

  • 1. MIND YOUR APP FOOTPRINT! 🐾⚡🌱 How to Reduce your Mobile App Footprint #FlutterHeroes24
  • 2. Alexandre POICHET Software Engineer Alexis CHOUPAULT Software Engineer François NOLLEN Staff Engineer Dev Rel
  • 3. 🧠 YOUR 📱 👣 ! • Why • Product & design • Developer techniques • 🔎 Basics • 🔎 Bundles • 🔎 On-demand • 🔎 DIY • Testing & Monitoring • 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 8 Building the right thing 🌱
  • 9. DOING THE RIGHT THING? 9 Finding a GOOD DEAL… • More engaged with final users • More compliant with environment ENVIRONMENT • Efficient Design • Accessibility FEATURES • Useful Features QUALITY • Good product value • Small bugs Where is the Green 🌱 part?
  • 10. 10 EX. WE SPOT TURTLES! 🌊🐢🌏 #WeArePlay We Spot Turtles! | Australia (Nicolas Guillot & Caitlin McKeown)
  • 11. 11 ♻ Retro-compatibility is crucial! 🐾 …yet it has a cost / footprint (tests, payloads, envs…) 👀 Monitor your app & user behaviours 🧹 Clean-up payloads when possible 🗑 Drop unused versions EX. BACKWARD COMPATIBILITY Version N-1 0,00% users Version N x,xx% users 👇
  • 12. 12 ♻ Unused features 📵 Deprecated versions 🎛 Complexity 🐾 Footprint FUNCTIONAL DEBT / WASTE « Less… …is more » 🛟 Accessibility ❤ User experience 💸 Product & business value
  • 13. MOBILE DEVELOPMENT Doing the thing right ♻ 13
  • 14. 14 ⚡ 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 ♻ 🔋 💚 🌱
  • 15. 15 • Display technologies : LCD vs. AMOLED • « Dark » mode or « black » mode? DARK MODES Our app results LCD AMOLED Light theme 3,9 g CO2 3,9 g CO2 Dark blue theme 3,9 g CO2 3.0 g CO2 (-23%) TLDR; « Not everything is Black & White » 😉 (Source: )
  • 16. 16 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
  • 17. 17 • Upgrading libs and frameworks ASAP • Leveraging new features and improvements …Including ⚡ and 🗜 ! STAYING UP-TO-DATE
  • 18. EXAMPLE 👉 IMPELLER 18 Before ⏳ (Skia only) After ⚡ (Impeller) (Emmanuel Lefebvre) @ Flutter Paris, Jan’23
  • 19. 19 REPAINT BOUNDARIES • Separate widgets to subtrees at rendering level, helps Flutter renderer know when repaint is needed • Can optimize screens with many interactions
  • 20. MOVING LOGIC TO THE BACK-END 20 • Pattern: 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
  • 21. RESULTS: PAYLOAD AND MORE 21 Data exchanged on the network (ko) [Ranking] Total payload on the network during navigation (source: )
  • 22. EXAMPLE: TRACKING & CONSENTS 22 S2S tracking vendors BFF server (Back-For-Front) Other channels (eg. chatbots) Mobile Web • Server-to-server tracking & consents (☝GDPR) • Custom frontend instrumentation (RouteObserver, EventListener) • Most logic, data and impacts moved to the back-end Removing 90% of 3rd-party SDKs from the frontend: • Less CPU, less storage, smaller footprint ⚡🗜🌱 • Less integration issues or crashes 💣 • Better UX 🙂
  • 23. 23 📦 App Bundles 🌴 Tree Shaking OPTIMIZING BUNDLES « App size is one of the biggest factors […]. It’s important to regularly monitor and understand how you can reduce your app’s download and install sizes. » Google Play Console Documentation
  • 24. ANDROID APP BUNDLES 24 • Android App Bundles • Optimized bundles for different devices • In our case (average): 📉 -48% weight
  • 25. OPTIMIZED BUNDLES FOR IOS 25 🗜 App Thinning 🗑 Unused Code and Resources ♻ Swift Language Features Available techniques 👉 refer to documentation
  • 26. 26 TREE SHAKING 🌴 Removes unused: • Functions • Fields • Types • Type params • Type args • Metadata • Lib entries • Classes • Libs
  • 27. TREE SHAKING IN PRACTICE 27 Use const at compile time (or conditional imports for Web) 1 VS. 2 Let’s Shake the Flutter Tree (Aleksander Denisov) @ Flutter Heroes ’23
  • 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 DEFERRED COMPONENTS 💤 Lazy loading at runtime 📲 On-demand features 🗜 Save phone storage 🐾 Reduce memory footprint (based on Android Dynamic Features ) 💡 Lazy loading gracely replaced by eager loading on platforms, not compatible (eg. iOS)
  • 30. EXAMPLE 30 💡 Defer the IDFM support in app? Public transportation for Paris only (ie. buy dematerialized metro tickets + use your phone as a ticket )
  • 31. 31 (Warning: a single missing import leads to no deferred lib) 1 2 DEFERRED COMPONENTS IN PRACTICE
  • 34. 34 ♻ Saving-energy mode? 🪫 Low battery detected? 🦕 Old device / low-end device detected? 💡 DIY: adjust your app footprint on-the-fly! CUSTOM ECO-MODE
  • 35. 35 🧑💻 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
  • 36. EXAMPLE 36 🤔 Disabling things from our onboarding wizard… On a low-end device (2018): - UI/accuracy slightly degraded ü FPS: +60 fps ü CPU usage (average): 79% à 36% 👉 All about choices and balance 💚 No hardcore dev skills required
  • 38. 38 Concevoir des paramètres écologiques dans les applications 🇫🇷 @ Mobilis In Mobile 2023 (Thomas Thibault) DESIGNING « ECO-FRIENDLY » USER PARAMS & OPTIONS
  • 40. RUNTIME ANALYSIS (EX. GREENSPECTOR) 85 Performance (Elapsed Time) 117.5 s Mobile Data 1.1 Mo 90 Energy 112.8 mAh 50 40 (Source: Greenspector 2022)
  • 41. 41 STATIC ANALYSIS (EX. ECOCODE) « Flutter Community, We need to build Flutter/Dart Eco Rules! » https://ecocode.io
  • 42. FLASHLIGHT « LIGHTHOUSE FOR MOBILE » 42 • Includes retries and iterations • Combines nicely with your e2e tests • Easy to compare runs • Video recording • Android only https://docs.flashlight.dev/
  • 43. 43 INTEGRATION TESTS (WITH CHROME TRACING / PERFETTO)
  • 44. GOLDEN TESTS 44 How does your App render on a small screen? ✅
  • 46. 46 Many ways to reduce your app footprint, optimize and reduce the waste ♻ Test and monitor your app performance over time, many tools are available 🔍 Solutions we all know, others few of us know. Learn, use, share your techniques 🌱
  • 47. RESOURCES WE’VE SHARED (🇫🇷 / 🇬🇧) 47 E2E Testing with Flutter Widget Testing with Flutter Accessibility Testing with Flutter Flutter @ Devoxx France Flutter Heroes 2023 Flutter Connection 2023