SlideShare une entreprise Scribd logo
1  sur  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="ïŹ‚u1erEmbedding"
android:value="2"/>
<meta-data
android:name="io.ïŹ‚u1er.embedding.engine.deferredcomponents.DeferredCom
ponentManager.loadingUnitMapping" android:value="2:idfm_sdk"/>
android:name="io.ïŹ‚u1er.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/

Contenu connexe

Similaire Ă  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
 
DevOps & SRE at Google Scale
DevOps & SRE at Google ScaleDevOps & SRE at Google Scale
DevOps & SRE at Google ScaleKaushik Bhattacharya
 
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
 

Similaire Ă  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
 

Plus 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
 

Plus 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
 

Dernier

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Hyderabad Call Girls Khairatabad ✹ 7001305949 ✹ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✹ 7001305949 ✹ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✹ 7001305949 ✹ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✹ 7001305949 ✹ Cheap Price Your BudgetEnjoy Anytime
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 

Dernier (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Hyderabad Call Girls Khairatabad ✹ 7001305949 ✹ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✹ 7001305949 ✹ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✹ 7001305949 ✹ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✹ 7001305949 ✹ Cheap Price Your Budget
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 

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
  • 39. TESTING & MONITORING ♻ 39
  • 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