Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Google I/O 2023 - Debugging Jetpack Composeについて
Search
Shun Miyazaki
June 08, 2023
Technology
0
960
Google I/O 2023 - Debugging Jetpack Composeについて
Google I/O 2023 に行われたセッション「Debugging Jetpack Compose」の内容 / 感想をまとめたものです。
Shun Miyazaki
June 08, 2023
Tweet
Share
More Decks by Shun Miyazaki
See All by Shun Miyazaki
DroidKaigi2025アプリのスクリーンショットテストが失敗していた原因を調べてみた
shunm
0
190
DroidKaigi アプリに初コントリビュートしました
shunm
0
85
Kotlinで簡単なDSLを作ってみる
shunm
0
49
Google I/O 2024 - Gemeni API on Androidの解説
shunm
0
780
Jetpack Compose で SharedElementTransitionっぽい挙動をやってみる
shunm
0
180
Other Decks in Technology
See All in Technology
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
16k
mablでリグレッションテストをデイリー実行するまで #mablExperience
bengo4com
0
470
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
0
100
HIG学習用スライド
yuukiw00w
0
110
セキュリティAIエージェントの現在と未来 / PSS #2 Takumi Session
flatt_security
3
1.3k
Docker, Infraestructuras seguras y Hardening
josejuansanchez
0
140
私も懇親会は苦手でした ~苦手だからこそ懇親会を楽しむ方法~ / 20251127 Masaki Okuda
shift_evolve
PRO
4
540
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
37k
なぜフロントエンド技術を追うのか?なぜカンファレンスに参加するのか?
sakito
8
1.9k
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
2.9k
MAP-7thplaceSolution
yukichi0403
2
240
あなたの知らないDateのひみつ / The Secret of "Date" You Haven't known #tqrk16
expajp
0
110
Featured
See All Featured
Docker and Python
trallard
46
3.7k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
1
70
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
GitHub's CSS Performance
jonrohan
1032
470k
Building Adaptive Systems
keathley
44
2.9k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
It's Worth the Effort
3n
187
29k
Embracing the Ebb and Flow
colly
88
4.9k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Typedesign – Prime Four
hannesfritz
42
2.9k
A better future with KSS
kneath
240
18k
Transcript
Google I/O 2023 Debugging Jetpack Compose について 宮﨑 瞬
本発表について 本発表は以下のセッション内容から、 個人的に気になった点をまとめたものです。 Debugging Jetpack Compose - Youtube h6ps://youtu.be/Kp-aiSU8qCU
セッション内容 Jetpack Composeの開発で、遭遇する問題の解決方法について、 解説してくれている。 Common Issues(⭐が本発表で話すところ) ・ Why is this
composable recomposing? ⭐ ・Problem: Frequent Recomposition ・How do I know what's wrong with my UI on different form factors? ・Why am I seeing Jank? ・Where should I focus on optimising?
Why is this composable recomposing? なぜ、このcomposableで、recomposeが実⾏されるのか?
Recomposeには3種類ある 1.Direct recomposition 変更された変数を参照しているComposeの、Recomposeが⾛る 2.Indirect recomposition 変更された変数を直接参照していないが、 変更された変数を、計算に使⽤している変数を参照しているComposableのRecomposeが⾛る 3.Unskippable recomposition
変更されていないが、 Unstableで、immutable(不変)であることを担保できないため、Recomposeが⾛る
Direct recomposition countが変更されると、TextのRecomposeが⾛る Debugging Jetpack Compose - Youtube https://youtu.be/Kp-aiSU8qCU
Indirect recomposition countが変更されると、 doubledが変更されて、MyTextのRecomposeが⾛る Debugging Jetpack Compose - Youtube h6ps://youtu.be/Kp-aiSU8qCU
Unskippable recomposition countが変更されると、listは値が変わっていないが、 Unstableなので、MyListのRecomposeが⾛る Debugging Jetpack Compose - Youtube h6ps://youtu.be/Kp-aiSU8qCU
Recomposeが 実⾏された理由をどうやって 確かめるか?
Compose state information in debugger Android Studio Hedgehogから、 Compose state
information in debuggerが使える h<ps://developer.android.com/studio/preview/features#compose- state-in-debugger Debugging Jetpack Compose - Youtube https://youtu.be/Kp-aiSU8qCU 検査したいところに、 breakpointを設置して、debugする。 Debuggerで、Recompositon Stateを見ることができる。
Debuggerで検証できるもの Changed State ・Unchanged - 変数は変更されていない ・Changed - 変数は変更された ・Uncertain
- 変数が変更されたかどうか、まだ評価中 ・Static - 変数は絶対に変更されない ・Unstable - 変数はunstable type(不変性が担保できない)
使⽤例1 isFollewedが変更されたので、Recomposeが実⾏ Debugging Jetpack Compose - Youtube https://youtu.be/Kp-aiSU8qCU
使⽤例2 podcastsがUnstableなので、Recomposeが実⾏ Debugging Jetpack Compose - Youtube h6ps://youtu.be/Kp-aiSU8qCU
まとめ ・Recomposeには3種類ある ・Android Studio Hedgehogで追加された、Compose state information in debuggerで、Recomposeの原因を検証できる