SlideShare una empresa de Scribd logo
1 de 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/

Más contenido relacionado

Similar a 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 a 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
 

Más de 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
 

Más de 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
 

Último

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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
[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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
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
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

Último (20)

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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
[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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
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
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

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