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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
ponday
June 25, 2017
Programming
750
0
Share
Angularは本当に速いのか?
ng-fukuoka Angular Meetup #1の登壇資料です。
ponday
June 25, 2017
More Decks by ponday
See All by ponday
関数型でGoFのデザインパターンやってみる
honda
1
1.6k
TypeScriptの型表現
honda
10
3.1k
Web Componentsの今
honda
1
470
これまでのReact、これからのReact
honda
0
340
Gatsbyお試し
honda
0
130
styled-components or emotion?
honda
0
720
Web ComponentsとAngular
honda
0
150
Atomic Design周りについての私見
honda
1
790
え、まだWeb Componentsを未来の技術だと思ってるの?
honda
2
880
Other Decks in Programming
See All in Programming
Agent Skills を社内で育てる仕組み作り
jackchuka
1
2.1k
決定論 vs 確率論:Gemini 3 FlashとTF-IDFを組み合わせた「法規判定エンジン」の構築
shukob
0
160
「なんか〇〇ライブラリで脆弱性あるみたいなんだけど。。。」から始める脆弱性対応 / First Steps in Vulnerability Response
mackey0225
2
130
[BalkanRuby 2026] Drop your app/services!
palkan
3
510
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
0
210
「OSSがあるなら自作するな」は AI時代も正しいか ── Build vs Adopt の新しい判断基準
kumorn5s
7
2.8k
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
3
960
プラグインで拡張される Context をtype-safe にする難しさと設計判断
kazupon
1
180
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
400
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
190
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
420
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
1
130
Featured
See All Featured
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
150
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
340
Statistics for Hackers
jakevdp
799
230k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
370
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
The Curious Case for Waylosing
cassininazir
1
350
Measuring & Analyzing Core Web Vitals
bluesmoon
9
820
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
180
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
200
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も速くなった!