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
Angularは本当に速いのか?
Search
ponday
June 25, 2017
Programming
0
740
Angularは本当に速いのか?
ng-fukuoka Angular Meetup #1の登壇資料です。
ponday
June 25, 2017
Tweet
Share
More Decks by ponday
See All by ponday
関数型でGoFのデザインパターンやってみる
honda
1
1.5k
TypeScriptの型表現
honda
10
3.1k
Web Componentsの今
honda
1
450
これまでのReact、これからのReact
honda
0
320
Gatsbyお試し
honda
0
120
styled-components or emotion?
honda
0
700
Web ComponentsとAngular
honda
0
140
Atomic Design周りについての私見
honda
1
750
え、まだWeb Componentsを未来の技術だと思ってるの?
honda
2
860
Other Decks in Programming
See All in Programming
PostgreSQLで手軽にDuckDBを使う!DuckDB&pg_duckdb入門/osc25hi-duckdb
takahashiikki
0
200
AtCoder Conference 2025
shindannin
0
740
GoLab2025 Recap
kuro_kurorrr
0
780
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
140
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
140
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
660
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
130
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
160
AIエージェントの設計で注意するべきポイント6選
har1101
5
2.5k
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
180
認証・認可の基本を学ぼう後編
kouyuume
0
250
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
4k
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
39k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
190
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
71
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
32
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
270
4 Signs Your Business is Dying
shpigford
187
22k
The untapped power of vector embeddings
frankvandijk
1
1.5k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
0
1.8k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
29
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
180
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
0
320
Transcript
Angularは本当に速いのか? ng-fukuoka Angular Meetup #1 / June 25, 2017 ponday(@ponday_dev)
Profile ponday (@ponday_dev) - chibi-developer - ng-fukuoka スタッフ community -
Kotlin, Java, C# etc... - JavaScript - Angular, Vue.js skill
AngularJS -> Angular 速くなった(らしい)
ほんとに?
測ってみる AngularとReactの速度比較 (AngularJS時代は AngularJS << Reactだったらしい) 以下の項目で比較してみる ① リストレンダリング(DOM) ②
リストレンダリング(コンポーネント) ③ パラメータ変更 → View反映
① リストレンダリング(DOM) リスト(100件, 1000件, 10000件)をレンダリング Angular React 100件 1,000件 10,000件
49.37ms 125.85ms 438.11ms 43.80ms 115.77ms 402.02ms
② リストレンダリング(コンポーネント) リスト(100件, 1000件, 10000件)をレンダリング Angular React 100件 1,000件 10,000件
55.73ms 154.31ms 632.97ms 64.72ms 177.30ms 842.09ms
③ パラメータ変更 → View反映 内部のパラメータを変更 → 表示に反映されるまでの時間を計測 Angular React 1,000件
23.66ms 41.13ms
Angularの変更検知 ・Angularの変更検知の仕組み = Change Detection ・zone.jsを活用。 あらゆる非同期処理を検知してパラメータの変更がないか チェックしている → Reactなどで流行った仮想DOMとは異なる考え方 ・各コンポーネントがChangeDetector(変更検知器)を 持つ。ChangeDetectorもコンポーネントツリーと
同じようにツリーを構成する。
Angularの変更検知 Component Component Component Component Component Component Change Detector Change
Detector Change Detector Change Detector Change Detector Change Detector
Angularの変更検知 DOM zone.js (NgZone) ApplicationRef Change Detection window オブジェクトを パッチ
Angularの変更検知 DOM zone.js (NgZone) ApplicationRef 通知 Change Detection イベント発生
Angularの変更検知 DOM zone.js (NgZone) ApplicationRef イベント発生 補足 Change Detection
Angularの変更検知 DOM zone.js (NgZone) ApplicationRef 変更チェックを実行 (tickメソッド) Change Detection
Angularの変更検知 DOM zone.js (NgZone) ApplicationRef Change Detection コンポーネント毎に変更をチェック → Viewに反映
コンポーネント毎にチェックって遅くないの? ・当然コストは0ではないが遅くない ・Reactの仮想DOMも似たようなもの → Angularが生成するコードはきちんと最適化される ・パラメータの型に応じて内部的に比較方法を切替えて ムダを省いている ・AngularJS時代はひたすらループしていた(らしい) Angularではイベントが起こらない限りチェックはしない
パフォーマンスチューニング ・そのままでも十分速い よほどパフォーマンスが求められない限り不要 ・オプションで変更チェックのタイミングも制御可能 ・ChangeDetectionを伴わない非同期処理も書ける → NgZone.runOutsideAngular() → スクロールやウィンドウのリサイズなどを省くと良いかも
まとめ ・レンダリングの速度はReactと遜色ない ・コンポーネントの生成コストはAngularの方が小さそう ・変更チェックについてもReact(仮想DOM)と遜色ない → ChangeDetectionすげえ
結論 Angularも速くなった!