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
First_Paintと_クリティカルレンダリングパス
Search
howdy39
April 13, 2018
Programming
0
550
First_Paintと_クリティカルレンダリングパス
howdy39
April 13, 2018
Tweet
Share
More Decks by howdy39
See All by howdy39
Slackbot × RAG で実現する社内情報検索の最適化
howdy39
2
580
AI新時代 情シスが向き合うべきAI活用戦略
howdy39
0
190
GAS x スプレッドシート x Looker Studio を組み合わせたデバイス管理 / DeviceMangent with GAS, SpreadSheet, Looker Studio
howdy39
3
1.6k
ChatGPTを使った 社内アシスタントBOTを作りました / ChatGPT Assistant Bot
howdy39
0
690
WebPagetestで始めるパフォーマンス計測 / Performance measurement starting with WebPagetest
howdy39
4
690
Storybookを用いたVue.js共通コンポーネント開発との戦い / stores-fights-storybook
howdy39
5
8.7k
gas-webpagetestで パフォーマンス計測を始めよう / get-started-measuring-performance-with-gas-webpagetest
howdy39
0
2.5k
Promise
howdy39
1
390
カラーユニバーサルデザイン / color universal design
howdy39
0
950
Other Decks in Programming
See All in Programming
タスクの特性や不確実性に応じた最適な作業スタイルの選択(ペアプロ・モブプロ・ソロプロ)と実践 / Optimal Work Style Selection: Pair, Mob, or Solo Programming.
honyanya
3
160
高度なUI/UXこそHotwireで作ろう Kaigi on Rails 2025
naofumi
4
3.9k
CSC305 Lecture 05
javiergs
PRO
0
210
CSC305 Lecture 02
javiergs
PRO
1
270
All About Angular's New Signal Forms
manfredsteyer
PRO
0
110
Pull-Requestの内容を1クリックで動作確認可能にするワークフロー
natmark
2
490
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
290
XP, Testing and ninja testing ZOZ5
m_seki
3
600
overlayPreferenceValue で実現する ピュア SwiftUI な AdMob ネイティブ広告
uhucream
0
180
Web Components で実現する Hotwire とフロントエンドフレームワークの橋渡し / Bridging with Web Components
da1chi
3
2k
NixOS + Kubernetesで構築する自宅サーバーのすべて
ichi_h3
0
540
アメ車でサンノゼを走ってきたよ!
s_shimotori
0
220
Featured
See All Featured
A designer walks into a library…
pauljervisheath
209
24k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
61k
Statistics for Hackers
jakevdp
799
220k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
Git: the NoSQL Database
bkeepers
PRO
431
66k
A better future with KSS
kneath
239
18k
Build your cross-platform service in a week with App Engine
jlugia
232
18k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
GraphQLとの向き合い方2022年版
quramy
49
14k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Designing for humans not robots
tammielis
254
26k
Transcript
First Paintと クリティカルレンダリングパス 2018/04/13 トップゲート社 第3回 フロントエンド勉強会 1
Web画面を表示するとき ブラウザは裏でどんなことを やっているのか 2
1. サブリソースを読み込む 2. a. DOMツリーを構築 b. CSSOMツリーを構築 3. レンダリングツリーを構築 4.
レイアウト 5. ペイント 3
1. サブリソースを読み込む 2. a. DOMツリーを構築 b. CSSOMツリーを構築 3. レンダリングツリーを構築 4.
レイアウト 5. ペイント 4
preload scanner 5
6 HTML読み込み→ css/js/画像などのサブリソースを 同時に読み込む CSS JavaScript image HTML プリロード スキャナ
Highest High/Medium/Low Low Priority
7 デモ) http://topgate.co.jp
1. サブリソースを読み込む 2. a. DOMツリーを構築 b. CSSOMツリーを構築 3. レンダリングツリーを構築 4.
レイアウト 5. ペイント 8
Document Object Model (DOM) 9
10 ツリー状にHTMLノードを構築
1. サブリソースを読み込む 2. a. DOMツリーを構築 b. CSSOMツリーを構築 3. レンダリングツリーを構築 4.
レイアウト 5. ペイント 11
CSS Object Model (CSSOM) 12
13 ツリー状にCSSノードを構築
1. サブリソースを読み込む 2. a. DOMツリーを構築 b. CSSOMツリーを構築 3. レンダリングツリーを構築 4.
レイアウト 5. ペイント 14
Render Tree 15
16 DOMとCSSOMを関連付ける
1. サブリソースを読み込む 2. a. DOMツリーを構築 b. CSSOMツリーを構築 3. レンダリングツリーを構築 4.
レイアウト 5. ペイント 17
Layout & Paint 18
19 画面の幅や高さからレイアウトを決めて描画
Critical Rendering Path (CRP) 20
1. サブリソースを読み込む 2. a. DOMツリーを構築 b. CSSOMツリーを構築 3. レンダリングツリーを構築 4.
レイアウト 5. ペイント 21 ペイントまでの 一連の流れ のこと
クリティカルレンダリングパスを 短縮すると 22
First Paint が早くなる 23
クリティカルレンダリングパス とCSSOMの関係 24
CSSOMの構築がおわるまでレ ンダリングツリーが作られない =描画されない 25
26 CSSOMツリー構築 DOMツリー構築
27 デモ) 1. コードの解説 2. h1は何色になる? 3. https://howdy39.github.io/study-critical- render-path/css-block.html ※回線速度を(10kb/s)程度に遅くして実
行
28 CSSOMツリー構築 めっちゃ時間か かった DOMツリー構築 すぐ終わった
クリティカルレンダリングパス とJavaScriptの関係 29
JavaScriptはDOMツリー構築を ストップさせる =描画されない 30
31 JavaScriptはDOM ツリーの構築を止 める
32 デモ) 1. コードの解説 2. https://howdy39.github.io/study-critical- render-path/js-block.html
33 CSSOMツリー構築 すぐ終わった DOMツリー構築 めっちゃ時間か かった
まとめ 34
DOMツリー・CSSOMツリー の構築を意識 した実装をすることで First Paint を早くすることが出来る 35
CSS最適化 36 • 圧縮 • メディアクエリ • インラインスタイル • セレクタ最適化
• 画面単位でCSSを読み込む
JS最適化 37 • 圧縮 • 後実行(</body>の直前/async/defer) • 画面単位でJavaScriptを読み込む
参考 38 https://developers.google.com/web/fundamentals/performance/critical-rendering-path https://www.html5rocks.com/ja/tutorials/internals/howbrowserswork https://coliss.com/articles/build-websites/operation/work/about-the-critical-rendering-path.html https://qiita.com/mamo/items/ff336b5cc0a1a95e03a7