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
Kill Pollingした話
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
sutiwo
July 21, 2017
Programming
1.6k
1
Share
Kill Pollingした話
sutiwo
July 21, 2017
More Decks by sutiwo
See All by sutiwo
攻めつづける FRESH! のWeb ver.新春
sutiwo
3
5.3k
FRESH! クライアントサイドパフォーマンス改善
sutiwo
1
2.5k
Other Decks in Programming
See All in Programming
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
150
Cloudflare で始める Data Platform
ta93abe
0
300
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
880
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
540
プラグインで拡張される Context をtype-safe にする難しさと設計判断
kazupon
2
290
色即是空、空即是色、データサイエンス
kamoneggi
1
160
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
210
サークル参加から学ぶ、小さな事業の回し方
yuzneri
0
230
AI 時代のソフトウェア設計の学び方
masuda220
PRO
14
4.5k
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
110
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
360
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
10
1.2k
Featured
See All Featured
Abbi's Birthday
coloredviolet
2
7.7k
Deep Space Network (abreviated)
tonyrice
0
150
Code Reviewing Like a Champion
maltzj
528
40k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.3k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
220
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
340
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
180
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
200
Transcript
Kill Pollingͨ͠ 2017 7.21 Վب࠲.tech#13 ʮϑϩϯτΤϯυΞʔΩςΫνϟษڧձʯLT @su9wo
• su9wo / su9wo_ •CyberAgent, Inc. •ϑϩϯτΤϯδχΞ •FRESH! hKps:/ /freshlive.tv
•WebPush • hKps:/ /twiKer.com/FRESH_STAFF/status/887960571487764481 •Service Workerͷಋೖ • hKps:/ /developers.cyberagent.co.jp/blog/archives/6057/ •ΞΫηγϏϦςΟΨΠυϥΠϯʹج͍࣮ͮͨ
• hKps:/ /openfresh.github.io/a11y-guidelines/ ϑϩϯτνʔϜͰ࠷ۙͬͯΔ͜ͱ
Kill Polling͢Δཧ༝ • ଈ࣌ੑ͕ͳ͍ • ͍߹ΘͤܗࣜͳͷͰɺແବͳ௨৴ൃੜ • ͔ͬ͜ѱ͍
• ൪εςʔλεͷߋ৽ (։࢝์ૹதऴྃ) • ൪εςʔλεͷߋ৽ (ແྉ༗ྉ) • ࢹௌͷߋ৽ • ίϝϯτͷߋ৽
• ։࢝ɾऴྃ࣌ؒͷߋ৽ FRESH!ͰͷϢʔεέʔε
None
None
None
None
None
SSE (Server-Sent Events) • αʔό͔ΒΫϥΠΞϯτͷ୯Ұํ௨৴ • ςΩετͷΈ(όΠφϦbase64͢Δ) • IE11polyfill hKps:/
/github.com/Yaffle/EventSource/
Plasma • hKps:/ /github.com/openfresh/plasma • ΠϕϯτϓογϡͷϛυϧΣΞ • WebϒϥβSSE / ωΠςΟϒΞϓϦgRPC
• SSEʹΑͬͯαʔό͔ΒΠϕϯτΛड͚औΔ͜ͱ͕Ͱ͖Δ • ಙͷߴ͍ঁੑ༏͖Πϯλʔϯੜ࡞
ྲྀΕ • ॳظϨϯμϦϯά࣌ʹσʔλΛStoreʹอ࣋ • Plasmaଓ new EventSource(url, opts);ʹ.addEventListener(); • ߋ৽Λݕͨ͠ΒStoreͰJSON.parse,
Object.assignͰࠩΛ্ॻ͖ • ൪ऴྃޙߋ৽ͷඞཁ͕ͳ͘ͳͬͨΒ.removeEventListener();
σόοά • DevToolsͰΈΕ·͢
݁Ռ
ϙʔϦϯάͷϦΫΤετׂ߹ 0 % 7,5 % 15 % 22,5 % 30
% ϦϦʔεલ ϦϦʔε ϦϦʔεཌ ϦϦʔεཌʑ 0,85 % 1,43 % 21,15 % 27,8 %