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
530
First_Paintと_クリティカルレンダリングパス
howdy39
April 13, 2018
Tweet
Share
More Decks by howdy39
See All by howdy39
Slackbot × RAG で実現する社内情報検索の最適化
howdy39
2
500
AI新時代 情シスが向き合うべきAI活用戦略
howdy39
0
150
GAS x スプレッドシート x Looker Studio を組み合わせたデバイス管理 / DeviceMangent with GAS, SpreadSheet, Looker Studio
howdy39
3
1.4k
ChatGPTを使った 社内アシスタントBOTを作りました / ChatGPT Assistant Bot
howdy39
0
620
WebPagetestで始めるパフォーマンス計測 / Performance measurement starting with WebPagetest
howdy39
4
640
Storybookを用いたVue.js共通コンポーネント開発との戦い / stores-fights-storybook
howdy39
5
8.6k
gas-webpagetestで パフォーマンス計測を始めよう / get-started-measuring-performance-with-gas-webpagetest
howdy39
0
2.4k
Promise
howdy39
1
340
カラーユニバーサルデザイン / color universal design
howdy39
0
860
Other Decks in Programming
See All in Programming
List とは何か? / PHPerKaigi 2025
meihei3
0
620
自分のために作ったアプリが、グローバルに使われるまで / Indie App Development Lunch LT
pixyzehn
1
150
AHC045_解説
shun_pi
0
450
マルチアカウント環境での、そこまでがんばらない RI/SP 運用設計
wa6sn
0
710
Agentic Applications with Symfony
el_stoffel
2
270
SQL Server ベクトル検索
odashinsuke
0
160
いまさら聞けない生成AI入門: 「生成AIを高速キャッチアップ」
soh9834
15
4.4k
アプリを起動せずにアプリを開発して品質と生産性を上げる
ishkawa
0
2.5k
PHPのガベージコレクションを深掘りしよう
rinchoku
0
260
Unlock the Potential of Swift Code Generation
rockname
0
240
Building a macOS screen saver with Kotlin (Android Makers 2025)
zsmb
1
140
リストビュー画面UX改善の振り返り
splcywolf
0
120
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
The World Runs on Bad Software
bkeepers
PRO
67
11k
Being A Developer After 40
akosma
91
590k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.2k
The Cult of Friendly URLs
andyhume
78
6.3k
Making the Leap to Tech Lead
cromwellryan
133
9.2k
Done Done
chrislema
183
16k
BBQ
matthewcrist
88
9.6k
Testing 201, or: Great Expectations
jmmastey
42
7.4k
Speed Design
sergeychernyshev
29
880
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
For a Future-Friendly Web
brad_frost
176
9.7k
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