SlideShare a Scribd company logo
1 of 94
Download to read offline
Frontrend in Nagoya
2014/6/21
@1000ch
Performance
Evangelist
パフォーマンス改善
および推進活動
名古屋初上陸!
Google I/O 2014
参加してきます!
Webフロントエンド最前線
新連載始まります!
To me, performance is a feature, and I simply like using
fast websites more than slow websites, so naturally I'm going to build a site that I would
want to use. But I think there's also a lesson to be learned here about the competitive
landscape of the public internet, where there are two kinds
of websites: the quick and the dead.
Performance is a Feature
http://blog.codinghorror.com/performance-is-a-feature/
パフォーマンスは
機能の1つである。
この世には2種類のWebサイトしかない。
早いか、死んでいる
かのどちらかだ。
パフォーマンスを軸にした
ユーザー体験の差…
ページが1秒で表示されると…
3秒経ってもページが表示されないと…
約60%のユーザーが離脱する
その内80%は2度と戻ってこない
ページビューの低下
ECサイトであれば売上の低下
各種コンバージョン
当たり前だけど、デメリットしかない
いくらコンテンツが良くても

遅いサイトにユーザーは来ない
Webパフォーマンスの3大要素
Render ComputeNetwork
Network (リソース取得関連)
Network
サーバーサイド
プログラム
DNS Lookup?
KeepAlive?
<img src=…>
<link href=…>
Render (描画関連)
Render
CSS3
CPU or GPU
Render Tree
= DOM + CSSOM
Compute (JS実行関連)
Compute
V8?
JIT Compile?
Garbage Collection
物理演算処理
ページが表示されるまで
Initialize Process
RenderNetwork Compute
閲覧中・ページを閉じるまで
Runtime Process
Render ComputeNetwork
Amebaあるある
プランナー ディベロッパー
ここにコンテンツを
追加したいです!
(どんどんページが縦
長になっていく…)
エンジニア ディベロッパー
サーバーサイドの
実装終わりましたー!
(このAPIまとめて欲
しかった…)
パフォーマンスに対する

開発者の意識の欠落…
プランナー ディベロッパー
このスケジュールで
お願いします!
(忙しくてチューニン
グどころじゃない…)
開発負荷が高すぎて

チューニングが後手に回される
デザイナー ディベロッパー
ここのマージン

やっぱり10pxで!
(また微調整か…)
エンジニア ディベロッパー
このAPIはこう返却す
るようにします!
(JSONの形式変えない
でくれーorz)
エンジニアとデザイナーの間で

板挟みになりがち
招かれる結果
積み上がるレガシーコード
デザインへの対応で肥大化するCSS
技術的負債
最適化せずリリースされるプロダクト
頻繁に行われるデザインリニューアル
短すぎるスケジュール
疲弊する開発者
とにかく色々とシビア
後になればなるほど
修正は困難になる
プロジェクト分析
遷移ベースがほとんど(SPA少ない)
ゲーム系プロダクトは特に運用が辛い
サービスの分布
ガラケーに対応している古参サービスも
イニシャルコストを最適化出来ていない
大量のサードパーティモジュール
コードの状態
長きに渡ったプロジェクトの負の遺産
結構大変…orz
各方面と
対話してもらう
「ボタンの余白、統一して!」
「この影ならCSSで出来るんですが!」
対デザイナー例
「画像の要らないテクスチャに!」
「ビルドフローに●●を含めて!」
「このレスポンス早くなりませんか!」
対エンジニア例
「キャッシュを効かせて!」
パフォーマンスに対する
意識を植え付ける
+
フロントエンドで(ある程度)
イニシアチブを取る
もちろん精神論だけ
ではダメなので…
具体的に数値を示し
対策を提案する
各種計測ツールが
あります
PageSpeed Insights
YSlow
PSI
Phantomas
WebPageTest
Kingfisher
WebPageTest Private Instance
社内専用のプライベートインスタンス
Ameba専用にUIをカスタマイズ
WebPageTest for
キュー待ちなし!APIキー不要!
これらのツールで
実際に計測する
発生している
HTTPリクエストの一覧
CSSや画像といった

サブリソースを返却する

サーバーレスポンス
HTMLを返却する

サーバーレスポンス
20:80
HTTPリクエストは…
Render ComputeNetwork
CSS・JSファイルの結合と圧縮
HTMLファイルの圧縮
ネットワーク最適化
画像の減色とメタ削除
キャッシュヘッダ・Gzip等
画像の最適化、重要
CSS、JSをいくら削減しても
画像の最適化を忘れれば水の泡
ファイルサイズの半分を
メタ情報が占めていることもある
たかが画像されど
キービジュアルでなければ
多少の劣化は許容する判断も必要
https://github.com/1000ch/compress-image
PNGの最適化
58,217 bytes 14,244 bytes
76%down
https://github.com/1000ch/compress-image
JPGの最適化
141,033 bytes 14,045 bytes
90%down
ImageOptim
ImageAlpha
grunt-image
これらの対策案を
プロジェクトに
フィードバック
@1000ch
プロジェクトBの人
ココを直して下さい!
プロジェクトAの人
プロジェクトAはやってくれた
プロジェクトBはやってくれなかった
その後…
忙しさに多少の差はあれど…
どうしても
属人的になる
コードを直してプルリクエスト
便利ツールの作成して使ってもらう
それでもだめなので
かくなる上は最終手段…
対策を義務化する
レスポンス選手権
ランキング付けして競争心をあおる
少しずつレスポンスを気にするように
レスポンス選手権
ストップウォッチで計測
ストップウォッチ…
(´・∀・`)?
(・×・)
爆レス大会
WebPageTestのプライベート版で計測
SpeedIndexとVisualCompleteが指標
爆レス大会
1日3回計測、1週毎に結果配信
1月に1度、ランキング上位に景品
Speed Index
0
2500
5000
7500
10000
5月1週 5月2週 5月3週 5月4週 5月5週
プロジェクトA
プロジェクトB
プロジェクトC
低ければ低い程
パフォーマンス良❤
Speed Index
0
2500
5000
7500
10000
5月1週 5月2週 5月3週 5月4週 5月5週
プロジェクトA
平均スコアNo.1
Speed Index
0
2500
5000
7500
10000
5月1週 5月2週 5月3週 5月4週 5月5週
プロジェクトB
改善率No.1
チューニンガソン
運用中では改善が後手に回ってしまう
PJから数人選出して連れて行く
短期集中改善合宿
長期的にダラダラやるより集中して直す
絶賛進行中…
徐々に広がる
パフォーマンス文化
パフォーマンスを
重要視する土壌が必要
開発の中心だからこそ
周りを巻き込んでいく
パフォーマンスとの
戦いは終わらない…
Re-think about Web Performance

More Related Content

Similar to Re-think about Web Performance

今後のWeb開発の未来を考えてangular jsにしました(拡大版)
今後のWeb開発の未来を考えてangular jsにしました(拡大版)今後のWeb開発の未来を考えてangular jsにしました(拡大版)
今後のWeb開発の未来を考えてangular jsにしました(拡大版)Mitsuru Ogawa
 
加賀さんと僕 〜艦これウィジェットの新機能とか〜
加賀さんと僕 〜艦これウィジェットの新機能とか〜加賀さんと僕 〜艦これウィジェットの新機能とか〜
加賀さんと僕 〜艦これウィジェットの新機能とか〜Hiromu Ochiai
 
ネットワーク分散型フレームワークConView
ネットワーク分散型フレームワークConViewネットワーク分散型フレームワークConView
ネットワーク分散型フレームワークConViewRakuten Group, Inc.
 
ウェブパフォーマンスの基礎とこれから
ウェブパフォーマンスの基礎とこれからウェブパフォーマンスの基礎とこれから
ウェブパフォーマンスの基礎とこれからHiroshi Kawada
 
Ec cube user group tokyo mtg 2.13に向けて
Ec cube user group tokyo mtg 2.13に向けてEc cube user group tokyo mtg 2.13に向けて
Ec cube user group tokyo mtg 2.13に向けてAyumu Kawaguchi
 
20101127 Android Usability Seminar
20101127 Android Usability Seminar20101127 Android Usability Seminar
20101127 Android Usability SeminarVisso株式会社
 
Enterprise Redmine
Enterprise RedmineEnterprise Redmine
Enterprise RedmineDai FUJIHARA
 

Similar to Re-think about Web Performance (9)

今後のWeb開発の未来を考えてangular jsにしました(拡大版)
今後のWeb開発の未来を考えてangular jsにしました(拡大版)今後のWeb開発の未来を考えてangular jsにしました(拡大版)
今後のWeb開発の未来を考えてangular jsにしました(拡大版)
 
加賀さんと僕 〜艦これウィジェットの新機能とか〜
加賀さんと僕 〜艦これウィジェットの新機能とか〜加賀さんと僕 〜艦これウィジェットの新機能とか〜
加賀さんと僕 〜艦これウィジェットの新機能とか〜
 
Com camp2014
Com camp2014Com camp2014
Com camp2014
 
ablogcms2014tokyo
ablogcms2014tokyoablogcms2014tokyo
ablogcms2014tokyo
 
ネットワーク分散型フレームワークConView
ネットワーク分散型フレームワークConViewネットワーク分散型フレームワークConView
ネットワーク分散型フレームワークConView
 
ウェブパフォーマンスの基礎とこれから
ウェブパフォーマンスの基礎とこれからウェブパフォーマンスの基礎とこれから
ウェブパフォーマンスの基礎とこれから
 
Ec cube user group tokyo mtg 2.13に向けて
Ec cube user group tokyo mtg 2.13に向けてEc cube user group tokyo mtg 2.13に向けて
Ec cube user group tokyo mtg 2.13に向けて
 
20101127 Android Usability Seminar
20101127 Android Usability Seminar20101127 Android Usability Seminar
20101127 Android Usability Seminar
 
Enterprise Redmine
Enterprise RedmineEnterprise Redmine
Enterprise Redmine
 

More from Shogo Sensui

Web Standards Interop 2022
Web Standards Interop 2022Web Standards Interop 2022
Web Standards Interop 2022Shogo Sensui
 
Introduction to Performance APIs
Introduction to Performance APIsIntroduction to Performance APIs
Introduction to Performance APIsShogo Sensui
 
Web Standards 2018
Web Standards 2018Web Standards 2018
Web Standards 2018Shogo Sensui
 
The State of Web Components
The State of Web ComponentsThe State of Web Components
The State of Web ComponentsShogo Sensui
 
Component of Web Frontend
Component of Web FrontendComponent of Web Frontend
Component of Web FrontendShogo Sensui
 
Web フロントエンドの変遷とこれから
Web フロントエンドの変遷とこれからWeb フロントエンドの変遷とこれから
Web フロントエンドの変遷とこれからShogo Sensui
 
Introduction to Resource Hints
Introduction to Resource HintsIntroduction to Resource Hints
Introduction to Resource HintsShogo Sensui
 
Web Components 2016 & Polymer v2
Web Components 2016 & Polymer v2Web Components 2016 & Polymer v2
Web Components 2016 & Polymer v2Shogo Sensui
 
これからのJavaScriptの話
これからのJavaScriptの話これからのJavaScriptの話
これからのJavaScriptの話Shogo Sensui
 
初心者のためのWeb標準技術
初心者のためのWeb標準技術初心者のためのWeb標準技術
初心者のためのWeb標準技術Shogo Sensui
 
Introduction to Service Worker
Introduction to Service WorkerIntroduction to Service Worker
Introduction to Service WorkerShogo Sensui
 
We should optimize images
We should optimize imagesWe should optimize images
We should optimize imagesShogo Sensui
 
Web Components changes Web Development
Web Components changes Web DevelopmentWeb Components changes Web Development
Web Components changes Web DevelopmentShogo Sensui
 
Browser Computing Structure
Browser Computing StructureBrowser Computing Structure
Browser Computing StructureShogo Sensui
 
Brush up your Coding! 2013 winter
Brush up your Coding! 2013 winterBrush up your Coding! 2013 winter
Brush up your Coding! 2013 winterShogo Sensui
 
Brush up your Coding!
Brush up your Coding!Brush up your Coding!
Brush up your Coding!Shogo Sensui
 
Functional JavaScript with Lo-Dash.js
Functional JavaScript with Lo-Dash.jsFunctional JavaScript with Lo-Dash.js
Functional JavaScript with Lo-Dash.jsShogo Sensui
 

More from Shogo Sensui (17)

Web Standards Interop 2022
Web Standards Interop 2022Web Standards Interop 2022
Web Standards Interop 2022
 
Introduction to Performance APIs
Introduction to Performance APIsIntroduction to Performance APIs
Introduction to Performance APIs
 
Web Standards 2018
Web Standards 2018Web Standards 2018
Web Standards 2018
 
The State of Web Components
The State of Web ComponentsThe State of Web Components
The State of Web Components
 
Component of Web Frontend
Component of Web FrontendComponent of Web Frontend
Component of Web Frontend
 
Web フロントエンドの変遷とこれから
Web フロントエンドの変遷とこれからWeb フロントエンドの変遷とこれから
Web フロントエンドの変遷とこれから
 
Introduction to Resource Hints
Introduction to Resource HintsIntroduction to Resource Hints
Introduction to Resource Hints
 
Web Components 2016 & Polymer v2
Web Components 2016 & Polymer v2Web Components 2016 & Polymer v2
Web Components 2016 & Polymer v2
 
これからのJavaScriptの話
これからのJavaScriptの話これからのJavaScriptの話
これからのJavaScriptの話
 
初心者のためのWeb標準技術
初心者のためのWeb標準技術初心者のためのWeb標準技術
初心者のためのWeb標準技術
 
Introduction to Service Worker
Introduction to Service WorkerIntroduction to Service Worker
Introduction to Service Worker
 
We should optimize images
We should optimize imagesWe should optimize images
We should optimize images
 
Web Components changes Web Development
Web Components changes Web DevelopmentWeb Components changes Web Development
Web Components changes Web Development
 
Browser Computing Structure
Browser Computing StructureBrowser Computing Structure
Browser Computing Structure
 
Brush up your Coding! 2013 winter
Brush up your Coding! 2013 winterBrush up your Coding! 2013 winter
Brush up your Coding! 2013 winter
 
Brush up your Coding!
Brush up your Coding!Brush up your Coding!
Brush up your Coding!
 
Functional JavaScript with Lo-Dash.js
Functional JavaScript with Lo-Dash.jsFunctional JavaScript with Lo-Dash.js
Functional JavaScript with Lo-Dash.js
 

Recently uploaded

論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)Hiroki Ichikura
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 

Recently uploaded (9)

論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 

Re-think about Web Performance