SlideShare ist ein Scribd-Unternehmen logo
1 von 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/

Weitere Ƥhnliche Inhalte

Ƅhnlich wie 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
Ā 

Ƅhnlich wie 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
Ā 

Mehr von 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 unifieĢe Server-to-Server - Tealium SNCF Connect (@EBG 2023)
Collecte unifieĢe Server-to-Server - Tealium SNCF Connect (@EBG 2023)Collecte unifieĢe Server-to-Server - Tealium SNCF Connect (@EBG 2023)
Collecte unifieĢ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
Ā 

Mehr von 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 unifieĢe Server-to-Server - Tealium SNCF Connect (@EBG 2023)
Collecte unifieĢe Server-to-Server - Tealium SNCF Connect (@EBG 2023)Collecte unifieĢe Server-to-Server - Tealium SNCF Connect (@EBG 2023)
Collecte unifieĢ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
Ā 

KĆ¼rzlich hochgeladen

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
Ā 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
Ā 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
Ā 
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
Ā 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
Ā 
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
Ā 
Bun (KitWorks Team Study ė…øė³„ė§ˆė£Ø ė°œķ‘œ 2024.4.22)
Bun (KitWorks Team Study ė…øė³„ė§ˆė£Ø ė°œķ‘œ 2024.4.22)Bun (KitWorks Team Study ė…øė³„ė§ˆė£Ø ė°œķ‘œ 2024.4.22)
Bun (KitWorks Team Study ė…øė³„ė§ˆė£Ø ė°œķ‘œ 2024.4.22)Wonjun Hwang
Ā 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
Ā 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
Ā 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
Ā 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
Ā 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
Ā 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
Ā 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
Ā 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
Ā 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
Ā 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
Ā 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
Ā 
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
Ā 

KĆ¼rzlich hochgeladen (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
Ā 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
Ā 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.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
Ā 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
Ā 
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
Ā 
Bun (KitWorks Team Study ė…øė³„ė§ˆė£Ø ė°œķ‘œ 2024.4.22)
Bun (KitWorks Team Study ė…øė³„ė§ˆė£Ø ė°œķ‘œ 2024.4.22)Bun (KitWorks Team Study ė…øė³„ė§ˆė£Ø ė°œķ‘œ 2024.4.22)
Bun (KitWorks Team Study ė…øė³„ė§ˆė£Ø ė°œķ‘œ 2024.4.22)
Ā 
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
Ā 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
Ā 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
Ā 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
Ā 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Ā 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Ā 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
Ā 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
Ā 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
Ā 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
Ā 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
Ā 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
Ā 
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
Ā 

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