Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
RepaintBoundary で Flutter のパフォーマンスを向上
Search
mine2424
June 17, 2024
Programming
0
280
RepaintBoundary で Flutter のパフォーマンスを向上
mine2424
June 17, 2024
Tweet
Share
More Decks by mine2424
See All by mine2424
アニメーションを最深まで理解してパフォーマンスを向上させる
mine2424
0
210
金融×キャリア教育で人生をシミュレーション
mine2424
0
110
実務2年目の学生がエンジニアとして働くことについて思ったこと
mine2424
0
110
Other Decks in Programming
See All in Programming
Azure AI Foundryのご紹介
qt_luigi
1
260
オニオンアーキテクチャを使って、 Unityと.NETでコードを共有する
soi013
0
380
さいきょうのレイヤードアーキテクチャについて考えてみた
yahiru
1
530
SwiftUIで単方向アーキテクチャを導入して得られた成果
takuyaosawa
0
140
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.3k
Amazon ECS とマイクロサービスから考えるシステム構成
hiyanger
1
180
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
3
3.7k
GitHub CopilotでTypeScriptの コード生成するワザップ
starfish719
28
6.1k
盆栽転じて家具となる / Bonsai and Furnitures
aereal
0
2.2k
[Fin-JAWS 第38回 ~re:Invent 2024 金融re:Cap~]FaultInjectionServiceアップデート@pre:Invent2024
shintaro_fukatsu
0
340
チームの立て直し施策をGoogleの 『効果的なチーム』と見比べてみた
maroon8021
0
270
AWSマネコンに複数のアカウントで入れるようになりました
yuhta28
2
150
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
33
3k
Writing Fast Ruby
sferik
628
61k
Code Reviewing Like a Champion
maltzj
521
39k
Designing for humans not robots
tammielis
250
25k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Statistics for Hackers
jakevdp
797
220k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
175
51k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
30
2.1k
Transcript
PUBLIC Flutter Meetup Tokyo #20 2024-06-17 RepaintBoundary で Flutter のパフォーマンスを向上
1
PUBLIC 自分を表す#(ハッシュタグ) みね (Ryota) # 奈良県出身 # ソフトテニス6年 # ポーカー1年
# F1 # 麻雀にはまり中 # 来年ポーカーの世界大会でます 経歴 大阪経済大学 経済学部卒 2024/4~ サイバーエージェント入社(24卒) X : nihon_kaizou github : mine2424 zenn: mine2424
PUBLIC RepaintBoundary とは? はみ出ている... 無駄なペンキ塗りが発生... 事前にテープを貼ろう!
PUBLIC RepaintBoundary とは? This widget creates a separate display list
for its child, which can improve performance if the subtree repaints at different times than the surrounding parts of the tree. 他と異なるタイミングで再描画される Widget を切り離す ex) animation, chart, CustomPaint, BackDropFilter etc… 頻繁に再描画されるもの
PUBLIC Deep Dive RepaintBoundary RenderObject とは? config, def state, lifecycle
painter
PUBLIC Deep Dive RepaintBoundary RenderObject.markNeedsPaint によって 描画が必要であるというフラグが立つ RenderObject.isRepaintBoundary を持つ一番近い祖先 である
RenderObject が再描画の対象となる (何も指定していないとアプリの root より子孫全てが再描画対象となる...) PaintingContext も同様
PUBLIC Deep Dive RepaintBoundary PaintingContext.paintChild() RenderObject.markNeedsPaint()
PUBLIC Deep Dive RepaintBoundary 実は Drawer にも RepaintBoundary が...! ref:
https://github.com/flutter/flutter/blob/5187cab7bdd434ca74abb45895d17e9fa553678a/packages/flutter/lib/src/material/drawer.dart#L690 DrawerControllerState
PUBLIC RepaintBoundary の使い所 Transform & ジャイロスコープ (sensors_plus)
PUBLIC RepaintBoundary の使い所
PUBLIC RepaintBoundary の使い所
PUBLIC RepaintBoundary の計測方法 Dev Tools の Flutter inspector より
PUBLIC RepaintBoundary の計測方法 main.dart にて 全ての RenderObject に対して timeline event
を生成 再描画箇所の 色が変わる!
PUBLIC まとめ • RepaintBoundary は異なるタイミングで再描画される widget と切り離すためにある • RenderObject 内で
どこで isRepaintBoundary が true に なっているかを見ている • debug によって直感的にも定量的にも使いどころが把握できる UI のパフォーマンスを向上させて 快適なアプリを構築!
PUBLIC END 15