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

Más contenido relacionado

La actualidad más candente

Principles of microservices XP Days Ukraine
Principles of microservices   XP Days UkrainePrinciples of microservices   XP Days Ukraine
Principles of microservices XP Days UkraineSam Newman
 
AWS re:Invent 2016: Building Enterprise Cloud Operations As a Service with T-...
AWS re:Invent 2016: Building Enterprise Cloud Operations As a Service with T-...AWS re:Invent 2016: Building Enterprise Cloud Operations As a Service with T-...
AWS re:Invent 2016: Building Enterprise Cloud Operations As a Service with T-...Amazon Web Services
 
エンタープライズ、アーキテクチャ、アジャイルのこれから
エンタープライズ、アーキテクチャ、アジャイルのこれからエンタープライズ、アーキテクチャ、アジャイルのこれから
エンタープライズ、アーキテクチャ、アジャイルのこれからYusuke Suzuki
 
Platform engineering 101
Platform engineering 101Platform engineering 101
Platform engineering 101Sander Knape
 
Team Topologies - how and why to design your teams - AllDayDevOps 2017
Team Topologies - how and why to design your teams - AllDayDevOps 2017Team Topologies - how and why to design your teams - AllDayDevOps 2017
Team Topologies - how and why to design your teams - AllDayDevOps 2017Matthew Skelton
 
3週連続DDDその2 深いモデルの探求(ドメイン駆動設計 第3部)
3週連続DDDその2  深いモデルの探求(ドメイン駆動設計 第3部)3週連続DDDその2  深いモデルの探求(ドメイン駆動設計 第3部)
3週連続DDDその2 深いモデルの探求(ドメイン駆動設計 第3部)増田 亨
 
Creating an Effective Roadmap for Your Cloud Journey (ENT225-R1) - AWS re:Inv...
Creating an Effective Roadmap for Your Cloud Journey (ENT225-R1) - AWS re:Inv...Creating an Effective Roadmap for Your Cloud Journey (ENT225-R1) - AWS re:Inv...
Creating an Effective Roadmap for Your Cloud Journey (ENT225-R1) - AWS re:Inv...Amazon Web Services
 
レガシーコードの複雑さに立ち向かう~ドメイン駆動設計のアプローチ
レガシーコードの複雑さに立ち向かう~ドメイン駆動設計のアプローチレガシーコードの複雑さに立ち向かう~ドメイン駆動設計のアプローチ
レガシーコードの複雑さに立ち向かう~ドメイン駆動設計のアプローチ増田 亨
 
マイクロサービスアーキテクチャの設計 - JUG2015
マイクロサービスアーキテクチャの設計 - JUG2015マイクロサービスアーキテクチャの設計 - JUG2015
マイクロサービスアーキテクチャの設計 - JUG2015Yusuke Suzuki
 
LayerXのQAチームで目指したい動き方 (社内資料)
LayerXのQAチームで目指したい動き方 (社内資料)LayerXのQAチームで目指したい動き方 (社内資料)
LayerXのQAチームで目指したい動き方 (社内資料)mosa siru
 
91APP 之API 經濟學與API Gateway與導入之旅
91APP 之API 經濟學與API Gateway與導入之旅91APP 之API 經濟學與API Gateway與導入之旅
91APP 之API 經濟學與API Gateway與導入之旅Amazon Web Services
 
The Paved Road at Netflix
The Paved Road at NetflixThe Paved Road at Netflix
The Paved Road at NetflixDianne Marsh
 
5分で出来る!イケてるconfluenceページ
5分で出来る!イケてるconfluenceページ5分で出来る!イケてるconfluenceページ
5分で出来る!イケてるconfluenceページCLARA ONLINE, Inc.
 
マイクロサービス化デザインパターン - #AWSDevDay Tokyo 2018
マイクロサービス化デザインパターン - #AWSDevDay Tokyo 2018マイクロサービス化デザインパターン - #AWSDevDay Tokyo 2018
マイクロサービス化デザインパターン - #AWSDevDay Tokyo 2018Yusuke Suzuki
 
ドメインオブジェクトの設計ガイドライン
ドメインオブジェクトの設計ガイドラインドメインオブジェクトの設計ガイドライン
ドメインオブジェクトの設計ガイドライン増田 亨
 
Reconstructing the SRE
Reconstructing the SREReconstructing the SRE
Reconstructing the SREBob Wise
 
SRE-iously: Defining the Principles, Habits, and Practices of Site Reliabilit...
SRE-iously: Defining the Principles, Habits, and Practices of Site Reliabilit...SRE-iously: Defining the Principles, Habits, and Practices of Site Reliabilit...
SRE-iously: Defining the Principles, Habits, and Practices of Site Reliabilit...New Relic
 
OReilly SACON London: Potholes in the road from monolithic hell: Microservice...
OReilly SACON London: Potholes in the road from monolithic hell: Microservice...OReilly SACON London: Potholes in the road from monolithic hell: Microservice...
OReilly SACON London: Potholes in the road from monolithic hell: Microservice...Chris Richardson
 
なぜ「マイクロサービス“化”」が必要なのか
なぜ「マイクロサービス“化”」が必要なのかなぜ「マイクロサービス“化”」が必要なのか
なぜ「マイクロサービス“化”」が必要なのかYusuke Suzuki
 

La actualidad más candente (20)

Principles of microservices XP Days Ukraine
Principles of microservices   XP Days UkrainePrinciples of microservices   XP Days Ukraine
Principles of microservices XP Days Ukraine
 
AWS re:Invent 2016: Building Enterprise Cloud Operations As a Service with T-...
AWS re:Invent 2016: Building Enterprise Cloud Operations As a Service with T-...AWS re:Invent 2016: Building Enterprise Cloud Operations As a Service with T-...
AWS re:Invent 2016: Building Enterprise Cloud Operations As a Service with T-...
 
エンタープライズ、アーキテクチャ、アジャイルのこれから
エンタープライズ、アーキテクチャ、アジャイルのこれからエンタープライズ、アーキテクチャ、アジャイルのこれから
エンタープライズ、アーキテクチャ、アジャイルのこれから
 
Platform engineering 101
Platform engineering 101Platform engineering 101
Platform engineering 101
 
Team Topologies - how and why to design your teams - AllDayDevOps 2017
Team Topologies - how and why to design your teams - AllDayDevOps 2017Team Topologies - how and why to design your teams - AllDayDevOps 2017
Team Topologies - how and why to design your teams - AllDayDevOps 2017
 
3週連続DDDその2 深いモデルの探求(ドメイン駆動設計 第3部)
3週連続DDDその2  深いモデルの探求(ドメイン駆動設計 第3部)3週連続DDDその2  深いモデルの探求(ドメイン駆動設計 第3部)
3週連続DDDその2 深いモデルの探求(ドメイン駆動設計 第3部)
 
Creating an Effective Roadmap for Your Cloud Journey (ENT225-R1) - AWS re:Inv...
Creating an Effective Roadmap for Your Cloud Journey (ENT225-R1) - AWS re:Inv...Creating an Effective Roadmap for Your Cloud Journey (ENT225-R1) - AWS re:Inv...
Creating an Effective Roadmap for Your Cloud Journey (ENT225-R1) - AWS re:Inv...
 
レガシーコードの複雑さに立ち向かう~ドメイン駆動設計のアプローチ
レガシーコードの複雑さに立ち向かう~ドメイン駆動設計のアプローチレガシーコードの複雑さに立ち向かう~ドメイン駆動設計のアプローチ
レガシーコードの複雑さに立ち向かう~ドメイン駆動設計のアプローチ
 
マイクロサービスアーキテクチャの設計 - JUG2015
マイクロサービスアーキテクチャの設計 - JUG2015マイクロサービスアーキテクチャの設計 - JUG2015
マイクロサービスアーキテクチャの設計 - JUG2015
 
LayerXのQAチームで目指したい動き方 (社内資料)
LayerXのQAチームで目指したい動き方 (社内資料)LayerXのQAチームで目指したい動き方 (社内資料)
LayerXのQAチームで目指したい動き方 (社内資料)
 
91APP 之API 經濟學與API Gateway與導入之旅
91APP 之API 經濟學與API Gateway與導入之旅91APP 之API 經濟學與API Gateway與導入之旅
91APP 之API 經濟學與API Gateway與導入之旅
 
The Paved Road at Netflix
The Paved Road at NetflixThe Paved Road at Netflix
The Paved Road at Netflix
 
5分で出来る!イケてるconfluenceページ
5分で出来る!イケてるconfluenceページ5分で出来る!イケてるconfluenceページ
5分で出来る!イケてるconfluenceページ
 
マイクロサービス化デザインパターン - #AWSDevDay Tokyo 2018
マイクロサービス化デザインパターン - #AWSDevDay Tokyo 2018マイクロサービス化デザインパターン - #AWSDevDay Tokyo 2018
マイクロサービス化デザインパターン - #AWSDevDay Tokyo 2018
 
ドメインオブジェクトの設計ガイドライン
ドメインオブジェクトの設計ガイドラインドメインオブジェクトの設計ガイドライン
ドメインオブジェクトの設計ガイドライン
 
Reconstructing the SRE
Reconstructing the SREReconstructing the SRE
Reconstructing the SRE
 
SRE-iously: Defining the Principles, Habits, and Practices of Site Reliabilit...
SRE-iously: Defining the Principles, Habits, and Practices of Site Reliabilit...SRE-iously: Defining the Principles, Habits, and Practices of Site Reliabilit...
SRE-iously: Defining the Principles, Habits, and Practices of Site Reliabilit...
 
DevOps & SRE at Google Scale
DevOps & SRE at Google ScaleDevOps & SRE at Google Scale
DevOps & SRE at Google Scale
 
OReilly SACON London: Potholes in the road from monolithic hell: Microservice...
OReilly SACON London: Potholes in the road from monolithic hell: Microservice...OReilly SACON London: Potholes in the road from monolithic hell: Microservice...
OReilly SACON London: Potholes in the road from monolithic hell: Microservice...
 
なぜ「マイクロサービス“化”」が必要なのか
なぜ「マイクロサービス“化”」が必要なのかなぜ「マイクロサービス“化”」が必要なのか
なぜ「マイクロサービス“化”」が必要なのか
 

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

Mind your App Footprint 🐾⚡️🌱 (@FlutterHeroes 2024)
Mind your App Footprint 🐾⚡️🌱 (@FlutterHeroes 2024)Mind your App Footprint 🐾⚡️🌱 (@FlutterHeroes 2024)
Mind your App Footprint 🐾⚡️🌱 (@FlutterHeroes 2024)François
 
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
 
Сергей Жук "Android Performance Tips & Tricks"
Сергей Жук "Android Performance Tips & Tricks"Сергей Жук "Android Performance Tips & Tricks"
Сергей Жук "Android Performance Tips & Tricks"Fwdays
 
Android Performance Tips & Tricks
Android Performance Tips & TricksAndroid Performance Tips & Tricks
Android Performance Tips & TricksSergii Zhuk
 
Batty consumerization of geospatial
Batty consumerization of geospatialBatty consumerization of geospatial
Batty consumerization of geospatialGeCo in the Rockies
 
Keep calm and write reusable code in Android
Keep calm and write reusable code in AndroidKeep calm and write reusable code in Android
Keep calm and write reusable code in AndroidJuan Camilo Sacanamboy
 
Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014Opersys inc.
 
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)François
 
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.UA Mobile
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteOpersys inc.
 
The Next Leap in JavaScript Performance
The Next Leap in JavaScript PerformanceThe Next Leap in JavaScript Performance
The Next Leap in JavaScript PerformanceIntel® Software
 
Is Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIIs Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIOpersys inc.
 
Keeping IoT stack in quality check - meetup IoT Under Test
Keeping IoT stack in quality check  - meetup IoT Under TestKeeping IoT stack in quality check  - meetup IoT Under Test
Keeping IoT stack in quality check - meetup IoT Under TestSilvair
 
Profiling Android Applications
Profiling Android ApplicationsProfiling Android Applications
Profiling Android Applicationshubx
 
Embedded Android Workshop at AnDevCon VI
Embedded Android Workshop at AnDevCon VIEmbedded Android Workshop at AnDevCon VI
Embedded Android Workshop at AnDevCon VIOpersys inc.
 
Is Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon VIs Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon VOpersys inc.
 
Droidcon it-2014-marco-grassi-viaforensics
Droidcon it-2014-marco-grassi-viaforensicsDroidcon it-2014-marco-grassi-viaforensics
Droidcon it-2014-marco-grassi-viaforensicsviaForensics
 
Community works for muli core embedded image processing
Community works for muli core embedded image processingCommunity works for muli core embedded image processing
Community works for muli core embedded image processingJeongpyo Kong
 
Embedded Android Workshop at Embedded World 2014
Embedded Android Workshop at Embedded World 2014Embedded Android Workshop at Embedded World 2014
Embedded Android Workshop at Embedded World 2014Opersys inc.
 
Optimizing Apps for Better Performance
Optimizing Apps for Better PerformanceOptimizing Apps for Better Performance
Optimizing Apps for Better PerformanceElif Boncuk
 

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

Mind your App Footprint 🐾⚡️🌱 (@FlutterHeroes 2024)
Mind your App Footprint 🐾⚡️🌱 (@FlutterHeroes 2024)Mind your App Footprint 🐾⚡️🌱 (@FlutterHeroes 2024)
Mind your App Footprint 🐾⚡️🌱 (@FlutterHeroes 2024)
 
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...
 
Сергей Жук "Android Performance Tips & Tricks"
Сергей Жук "Android Performance Tips & Tricks"Сергей Жук "Android Performance Tips & Tricks"
Сергей Жук "Android Performance Tips & Tricks"
 
Android Performance Tips & Tricks
Android Performance Tips & TricksAndroid Performance Tips & Tricks
Android Performance Tips & Tricks
 
Batty consumerization of geospatial
Batty consumerization of geospatialBatty consumerization of geospatial
Batty consumerization of geospatial
 
Keep calm and write reusable code in Android
Keep calm and write reusable code in AndroidKeep calm and write reusable code in Android
Keep calm and write reusable code in Android
 
Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014Is Android the New King of Embedded OSes at Embedded World 2014
Is Android the New King of Embedded OSes at Embedded World 2014
 
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)
The Story of SNCF Connect - biggest Flutter app in Europe (@FlutterHeroes 2023)
 
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
Критика "библиотечного" подхода в разработке под Android. UA Mobile 2016.
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform Toolsuite
 
The Next Leap in JavaScript Performance
The Next Leap in JavaScript PerformanceThe Next Leap in JavaScript Performance
The Next Leap in JavaScript Performance
 
Is Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIIs Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VI
 
Keeping IoT stack in quality check - meetup IoT Under Test
Keeping IoT stack in quality check  - meetup IoT Under TestKeeping IoT stack in quality check  - meetup IoT Under Test
Keeping IoT stack in quality check - meetup IoT Under Test
 
Profiling Android Applications
Profiling Android ApplicationsProfiling Android Applications
Profiling Android Applications
 
Embedded Android Workshop at AnDevCon VI
Embedded Android Workshop at AnDevCon VIEmbedded Android Workshop at AnDevCon VI
Embedded Android Workshop at AnDevCon VI
 
Is Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon VIs Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon V
 
Droidcon it-2014-marco-grassi-viaforensics
Droidcon it-2014-marco-grassi-viaforensicsDroidcon it-2014-marco-grassi-viaforensics
Droidcon it-2014-marco-grassi-viaforensics
 
Community works for muli core embedded image processing
Community works for muli core embedded image processingCommunity works for muli core embedded image processing
Community works for muli core embedded image processing
 
Embedded Android Workshop at Embedded World 2014
Embedded Android Workshop at Embedded World 2014Embedded Android Workshop at Embedded World 2014
Embedded Android Workshop at Embedded World 2014
 
Optimizing Apps for Better Performance
Optimizing Apps for Better PerformanceOptimizing Apps for Better Performance
Optimizing Apps for Better Performance
 

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
 
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
 
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 (9)

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)
 
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
 
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

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
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
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
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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
 
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
 
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
 
[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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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
 

Último (20)

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
 
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?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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)
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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...
 
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
 
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
 
[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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 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
 

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

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