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
Microarchitecture using Angular 4 as an example
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
GDG Cherkasy
May 29, 2017
Programming
200
0
Share
Microarchitecture using Angular 4 as an example
Kirill Gusyatin, JS developer at eKreative
GDG Cherkasy
May 29, 2017
More Decks by GDG Cherkasy
See All by GDG Cherkasy
Трансформація від розробника до ліда: байки та поради.
gdgcherkasy
0
150
Емоції: усвідомлення, прийняття, комунікація
gdgcherkasy
0
130
Kibana Plugin Development - Vlad Bolibruk
gdgcherkasy
0
90
“Why JS is way to go for backend”
gdgcherkasy
0
90
CoreData, custom merge policy
gdgcherkasy
2
1.6k
macOS_for_iOS_devs2.pdf
gdgcherkasy
0
86
MQTT.pdf
gdgcherkasy
1
51
Инструменты Lean Product Management как точки пересечения проектов с "реальностью": хватит клонировать плохие решения!
gdgcherkasy
1
91
Насколько силен Иммунитет вашей организации?
gdgcherkasy
1
120
Other Decks in Programming
See All in Programming
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
140
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
140
AI駆動開発勉強会 広島支部 第一回勉強会 AI駆動開発概要とワークショップ
hayatoshimiu
0
440
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
110
Lessons from Spec-Driven Development
simas
PRO
0
140
ふつうのFeature Flag実践入門
irof
7
3.6k
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
4
1.1k
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
500
CSC307 Lecture 17
javiergs
PRO
0
310
3Dシーンの圧縮
fadis
1
650
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.2k
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
310
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
41
2.5k
Statistics for Hackers
jakevdp
799
230k
Optimizing for Happiness
mojombo
378
71k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
430
Deep Space Network (abreviated)
tonyrice
0
160
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
Making Projects Easy
brettharned
120
6.7k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.3k
The World Runs on Bad Software
bkeepers
PRO
72
12k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
290
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
350
Transcript
Microarchitecture using Angular 4 as an example
Hello! I am Kirill Gusyatin You can find me at
[email protected]
Based on Pascal Precht’s thoughts
Microarchitecture Where does this start?
None
MICROARCHITECTURE MICROARCHITECTURE EVERYWHERE
Why?
“ Microarchitecture is an architecture of microelement
Angular framework Let’s have an example with 4200 d’n’d boxes
app.component.html
App.component.ts (1/2)
App.component.ts (2/2)
box.component.ts
box.component.html
Measure performance
None
Initial results Max Min 1 28ms 19ms 2 30ms 21ms
3 25ms 17ms
Let’s do it faster
Our process is easy ChangeDetectionStrategy.OnPush Detach change detectors “Simple” NgFor
ChangeDetectionStrategy.OnPush Use Angular’s OnPush change detection strategy to save view
bindings per change detection task
None
box.component.ts
app.component.ts
ChangeDetectionStrategy.OnPush Max Min 1 15ms 13ms 2 18ms 13ms 3
16ms 14ms
“Simple” NgFor Angular’s NgFor directive is sometimes a little bit
too smart. A simpler version of it could be faster
app.component.html
“Simple” NgFor Max Min 1 16ms 11ms 2 15ms 9ms
3 18ms 10ms
Detach change detectors Another option is to detach all change
detectors from the tree and only perform change detection for the components that is actually changing
app.component.ts
box.component.ts
box.component.ts
app.component.ts
box.component.ts
Detach change detectors Max Min 1 0.52ms 0.059ms 2 0.83ms
0.064ms 3 0.47ms 0.040ms
General (medians) Max Min Initial code 28ms 19ms ChangeDetectionStrategy.OnPush 16ms
13ms “Simple” NgFor 16ms 10ms Detach change detectors 0.606ms 0.054ms
Thanks! Any questions? You can find me at
[email protected]
&
github.com/kikill95
Worth to read ◍ https://goo.gl/MMW0Pe ◍ https://goo.gl/Gz0PqC