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
Rail というUIパフォーマンスモデル
Search
Benoît Quenaudon
April 05, 2016
Programming
1
130
Rail というUIパフォーマンスモデル
Benoît Quenaudon
April 05, 2016
Tweet
Share
More Decks by Benoît Quenaudon
See All by Benoît Quenaudon
36・15 Cash App
oldergod
1
180
Sweet Architecture
oldergod
1
360
Architecture at Scale (droidconNYC 2022)
oldergod
2
590
Managing gRPC with Wire
oldergod
2
520
Wire & Proto3
oldergod
0
78
Effective Reactive Architecture
oldergod
2
210
Wire 3 : Tackling gRPC with Kotlin
oldergod
0
970
Server Driven UI Workflow
oldergod
2
480
Applying Rx Best Practices to Your Architecture
oldergod
1
230
Other Decks in Programming
See All in Programming
.NET Frameworkでも汎用ホストが使いたい!
tomokusaba
0
200
Flutter × Firebase Genkit で加速する生成 AI アプリ開発
coborinai
0
170
CDKを使ったPagerDuty連携インフラのテンプレート化
shibuya_shogo
0
100
Datadog Workflow Automation で圧倒的価値提供
showwin
1
160
機能が複雑化しても 頼りになる FactoryBotの話
tamikof
0
100
Honoをフロントエンドで使う 3つのやり方
yusukebe
7
3.5k
複数のAWSアカウントから横断で 利用する Lambda Authorizer の作り方
tc3jp
0
110
メンテが命: PHPフレームワークのコンテナ化とアップグレード戦略
shunta27
0
300
パスキーのすべて ── 導入・UX設計・実装の紹介 / 20250213 パスキー開発者の集い
kuralab
3
880
密集、ドキュメントのコロケーション with AWS Lambda
satoshi256kbyte
1
210
Datadog DBMでなにができる? JDDUG Meetup#7
nealle
0
140
SwiftUI Viewの責務分離
elmetal
PRO
2
270
Featured
See All Featured
Navigating Team Friction
lara
183
15k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
250
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
A designer walks into a library…
pauljervisheath
205
24k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Typedesign – Prime Four
hannesfritz
40
2.5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
12
990
GraphQLとの向き合い方2022年版
quramy
44
14k
Transcript
RAILという UIパフォーマンスモデル User中心
By - 2015年中から - Fluentカンファレンスに発表があった。 - ユーザを中心にしたアプリのパフォーマンスモデ ル。 - Chromeチームから生まれたもので話はWebアプリに寄りがち。
- ネイティブアプリでも使える。
パフォーマンス 対 成功性 パフォーマンス 遅すぎる ユーザ退場 ま〜ま〜 ユーザ残る サクサク ユーザ喜ぶ
サクサク ROI? 成 功 性
パフォーマンス 対 成功性 パフォーマンス サクサク ユーザ喜ぶ 成 功 性 遅すぎる
ROI 減少
- 遅いって何?50msは遅い?速い? ⇒ ユーザはどう感じる?
ユーザが感じる:返事 遅延 所感 0 - 100 ms 即刻 100 -
1000 ms 集中切れず遅延を感じる 1000+ ms 脳コンテキストスイッチ 10,000+ ms また今度
ユーザが感じる:アニメーション 24 FPS(~40 ms) 違和感がない 60 FPS(~16 ms) サクサク感じる ただし、全体のFPSに統一感が無ければ
FPS をさげて統 一感を守った方がユーザに優しい。 ※FPS:Frame Per Second
アプリ内のフロー:アクション目線 読んでいる・考えている ステート変更 進捗表示 ナビゲーション クリック トランジション ドラッグ スクロール 読み込み
Idle Animation Response Load
None
Response - Tap to Paint:100ms - 100ms以内、ユーザのインプットに対してフィード バックを - 300ms以上かかりそうなら、その旨もフィードバック
で伝える - 逆目線:100msが経つまで処理してもユーザは気づかない
Response:GChrome風 onListItemClick() { let spinnerTimeout = setTimeout(showSpinner, 300); loadDetailsData().then(data =>
{ clearTimeout(spinnerTimeout); hideSpinner(); transitionToDetailsView(data); } }
Animation - 16ms - ブラウザやOSの処理もあるから8msぐらいまで狙った方が良い - 実現するのは難しい ⇒ アニメーション中は処理をしないのがベストプラク ティス
- iOS 対 Android も昔でその面で大きく違った - GChrome風:FLIP ※詳細説明は後ほど
Idle - バックグラウンド処理はここでする! - ユーザは操作していないけどするかも?のスタンスで ⇒ 50msで終わる単位で - ユーザが操作しだした時に即刻(100ms以内)に応えられるため
Idle:GChrome風 - requestIdleCallback - Chromeのみ(47+) - 標準化されていないがEDはある - https://w3c.github.io/requestidlecallback/ Window.requestIdleCallback(callback[,
options]);
Idle:GChrome風 let tasks = []; let MIN_TASK_TIME = 20; function
handleTasks(deadline) { while (tasks.length && deadline.timeRemaining() > MIN_TASK_TIME) processTask(tasks.pop()); if (tasks.length) requestIdleCallback(handleTasks); } requestIdleCallback(handleTasks);
Load - ユーザのインプットのゴールを達成する - 1s:意味のあるペイントまでの時間 - 実現するのは難しい - 1s 以内にすべてを表示する必要はない
- キャッシング(Service Worker)、ストリーミング等 - クリティカルレンダリングパスに集中する
Load:プログレッシブレンダリング 改善されたプロ グレッシブレンダ リング 改善されていな いレンダリング
RAIL:まとめ Response < 100ms 即刻ユーザにフィードバックを Animation < 16ms サクサク、統一感上で動く Idle
< 50ms バックグラウンド処理をする Load < 1000ms クリティカル情報を先に出す あなたのアプリのRAILはどうなっているの?
パフォーマンスって改善して意味あるのか。 - Google:2% スピード減少 = 2% ユーザ検索減少 - Yahoo:400ms 速度上昇
= 9% トラフィック増加 - AOL:速いロード = PV増加 - Amazon:100ms 速度上昇 = 1% 売上増加 - Google:ウェブサイトのスピードがランキングの指標としてある
世の中の列 - グーグラーが作ったボイスメモ - https://voice-memos.appspot.com/ - インドのFlipkart - http://www.flipkart.com/ -
Google I/O 2015 - https://events.google.com/io2015/
Animation:GChrome風 - アニメーション中に処理したらあかんならその前に すれば良い - レンダリングにコストの高い処理を避ける事が目的 - https://github.com/GoogleChrome/flipjs
Animation:GCのピクセルパイプライン - Javascript:画面に変更のある処理を担う(javascriptに限らず) - Style:どのCSSルールがどのElementに一致する算定 - Layout:各Elementの性質とそのポジションを計算 - Paint:各レイヤーのピクセルをペイントする -
Composite:すべてのレイヤーをうまい事、画面に表示する どのプロパティがどの処理を実行するか?⇒ http://csstriggers.com/
Animation:ローコストレンダリング Response Animation • Position: transform: translate(mpx, npx); • Scale:
transform: scale(n); • Rotation: transform: rotate(ndeg); • Opacity: opacity: 0...1; 100ms 100ms にAnimationに必要な処理を入れれば?
Animation:FLIP技 - First:初期の状態を記録。(位置+サイズ) - Last:アニメーション後の状態に更新 - 例:el.classList.add(‘expanded’); - Invert:transformを利用してコンポネントを処理の状態の戻す -
例:transform: translate(-100px, -50px) scale(0.3); - Play:Invertで適用したスタイルを無効にし、最低コストで最後 の状態に更に戻す - 例:transform: none;
Animation:FLIP技
パフォーマンスAudit - Chrome DevTools - http://www.webpagetest.org/ - https://developers.google.com/speed/pagespeed/insights/ - http://developer.android.com/training/testing/performance.h
tml
None
None
None
None
RAIL勉強会 以上。