Тёмный

Performance Optimization with @Stable and @Immutable in Jetpack Compose 

Philipp Lackner
Подписаться 175 тыс.
Просмотров 22 тыс.
50% 1

In this video you will learn how you can optimize your performance with Stable and Immutable in Jet Compose.
💻 Let me be your mentor and become an industry-ready Android developer in 10 weeks:
pl-coding.com/drop-table-ment...
⭐ Courses with real-life practices
⭐ Save countless hours of time
⭐ 100% money back guarantee for 30 days
⭐ Become a professional Android developer now:
pl-coding.com/premium-courses...
Get my FREE PDF about 20 things you should never do in Jetpack Compose:
pl-coding.com/jetpack-compose...
Regular programming advice on my Instagram page: / _philipplackner_
Join my Discord server:
/ discord

Опубликовано:

 

19 дек 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 40   
@nguyenvietquang2065
@nguyenvietquang2065 7 месяцев назад
Some facts i learned about recomposition: - var is always considered Unstable. It is the same concept with Phillip's List example. - viewModel is always unstable. - lambda may be stable or not, based on every "global" object you use inside it, for example using viewModel or var (not mutable state) will cause the function unskipable. For details, lambdas are anonymous classes keeping 1) the lambda content itself and 2) every objects that lambda is using other than parameters itself holds P/s: Overusing @Stable and @Immutable will sometimes make funny moments when your UI seems to not update instead log say yes 😂
@kinggeorges625
@kinggeorges625 7 месяцев назад
Thanks for the video. Can't wait for another full project tutorial
@yuuzuX
@yuuzuX 7 месяцев назад
Thank you for helping us to boost up our app performance.
@unknownBoy85lover
@unknownBoy85lover 7 месяцев назад
It's great for me that I started compose thank you sir
@RahulKumar-un6ur
@RahulKumar-un6ur 7 месяцев назад
Awesome...Philipp...😎😎
@mortezamgh1347
@mortezamgh1347 2 месяца назад
Thanks, that was very helpful
@user-eq2um3jv9y
@user-eq2um3jv9y 7 месяцев назад
Great video. Honestly seems a bit silly to have to wrap a list with a state class just to mark it as stable. Would be awesome if we can eventually just annotate single params like you did at 6:38. Will probably stick to the ImmutableList approach because of this (provided the list doesn't merge well into an existing state)
@nayabsarfraz586
@nayabsarfraz586 7 месяцев назад
This is so helpful 👏
@venkatesh4307
@venkatesh4307 7 месяцев назад
Great explanation
@ankitverma3932
@ankitverma3932 7 месяцев назад
Really helpful video. Plz make a video on Defer state reads and state hoisting.
@zafar_codes
@zafar_codes 7 месяцев назад
Cool. Also would like to see your video about performance and how to profile app using android studio’s profiler.
@mustafaammar551
@mustafaammar551 7 месяцев назад
thank you bro
@redaelmadini
@redaelmadini 7 месяцев назад
Very very good 👍 🎉
@shahriarzaman4715
@shahriarzaman4715 7 месяцев назад
Every youtuber: How to make a simple todo list app in jetpack compose Philipp: Hey guys! Let's learn some advance topic Me: Why philipp is not uploading new video!!
@Rafaelrgm
@Rafaelrgm 7 месяцев назад
Great Video. I wanna take the chance to ask for a new tutorial of a chat app using ktor and websockets, since the last one was about 2 years ago and is mostly deprecated... In my case the initial project couldn't even be built.
@brightonshifu
@brightonshifu 6 месяцев назад
This would be awesome.
@user-hj6gg4iq5p
@user-hj6gg4iq5p 7 месяцев назад
Maybe recomposition becomes because your `var selected` is out of Column?
@hoanghai5572
@hoanghai5572 7 месяцев назад
Seem like you change list to immutableList, if my list is still mutable, there is no way to prevent ContactList re-composed right ?
@icodethis
@icodethis 7 месяцев назад
goat
@keepgoingman5829
@keepgoingman5829 6 месяцев назад
How about the code below? Does it can be a problem too? @Immutable data class User( val name: String, val age: Int ) { var address: String = "" } you can see the 'address' with Var in the body of the data class. Does it could be a bad performance?
@GeorgeC-ur9yw
@GeorgeC-ur9yw 23 дня назад
how do you notify compose compiler that @Stable object has changed? or how do you pass a new instance of @Imutable anotated class?
@jasv49
@jasv49 7 месяцев назад
How does this apply if we use ViewModels for UI state management?
@mieszkokozma4239
@mieszkokozma4239 7 месяцев назад
Exactly the same. It's all about the class you use as a state aka model for the functions marked @Composable
@solomonenakele7219
@solomonenakele7219 6 месяцев назад
Please why is Horizontal pager lagging so much, even after optimising recompositions.
@virajbenade5572
@virajbenade5572 Месяц назад
Dear sir I have one serious question when we generate a model classes for our api response can we mark is at a @stable or @Immutable 😊
@517Amit
@517Amit 7 месяцев назад
Don't know why >my layout inspector can't detect any component tree. I tried almost all the solutions from stack and from internet. But seems like on of them works. hedgehog
@jms7634
@jms7634 6 месяцев назад
My problem with programming is it takes me like a hundred lines of code before i know when to use such annotation or any other concept. Optimization is such a headache but is a very crucial part when coding
@dmytroberezhnyi717
@dmytroberezhnyi717 7 месяцев назад
There is more info about @Stable when we have custom modifiers
@jimpauloovejera2599
@jimpauloovejera2599 4 месяца назад
you marked the class as @Stable but it would have been better if you try to update the state to showcase its stability
@owenthompson8397
@owenthompson8397 5 месяцев назад
If you annotate a class as @Immutable which implies that the data class can never change, but it does and creates a new instance, wouldn't that have an impact on assigning more memory to accommodate the new instance.and also invoke recoposition?
@loafic
@loafic Месяц назад
it's just a shallow copy, reorganizing the external Compose components, and most of the internal components will be skipped
@imamyusupbachtiar5461
@imamyusupbachtiar5461 7 месяцев назад
Sir, is your online course lifetime if i buy it ? i still consider it to buy
@PhilippLackner
@PhilippLackner 7 месяцев назад
yes :)
@esneider
@esneider 7 месяцев назад
soy tu fanboy
@arozendojr
@arozendojr 7 месяцев назад
Suggestion, webview with kmp compose, as large companies use it, reason for use, code push on the website that the webview accesses, feature delivered faster, Cloud scalability, micro frontEnd, micro service in the cloud
@cursedfunction
@cursedfunction 7 месяцев назад
Please don’t do this. Use the right tool for the job. WebViews are not the do-it-all tool that some folks try to make them out to be.
@arozendojr
@arozendojr 7 месяцев назад
@@cursedfunction Market needs, code push, kotlin or swift do not have code push, the market finds webview solutions. Nowadays large companies use webview, for native code @JavascriptInterface, in the end they are creating a meta browser
@cularu1
@cularu1 Месяц назад
It's horrible.
@cularu1
@cularu1 Месяц назад
It's only good to update the "app" faster. It's basically a webpage not an app.
@khanra17
@khanra17 4 месяца назад
Jetpack Compose is terrible! They had a chance to switch to a modern paradigm and they made dog poop. Everything is hacky and complex.
Далее
They got a Golden Buzzer 🤣✨
00:46
Просмотров 10 млн
Generics: The most intimidating TypeScript feature
18:19
More performance tips for Jetpack Compose
20:47
Просмотров 38 тыс.
Inspecting Performance - MAD Skills
16:01
Просмотров 20 тыс.