22. Dependency Tracking
Knockout / Vue 1.x
a
setter
getter
b
Watcher
a.b
Collect
Dependencies
Bindings
DOM
Notify
Update
Notify
Perf characteristics:
Efficient for small updates / more initialization cost
23. Virtual DOM
React etc.
Perf characteristics:
Bound by render/diff costs of dirty sub tree
New Virtual DOM Tree
DOM
Old Virtual DOM Tree
diff + patch
Render
Function
30. Immutable Data Everywhere +
Single State Tree
Pros:
Simpler shouldComponentUpdate
Cons:
● Immutable data in JavaScript isn’t as smooth as in real
functional languages
● Component local state can still be useful sometimes
31. Virtual DOM + Dependency Tracking
(Vue 2.0)
Pros:
Optimized updates out of the box
Cons:
Small initialization/bookkeeping cost
Watcher
track
dependencies
32. Elm
Simple lazy check thanks to immutability and
pure function guarantee.
Pros/Cons:
You get/need to use Elm.
lazy
33. Web Workers
Move expensive JavaScript computations off the main
thread.
Pros:
More responsive interactions
Cons:
Marginal gains with increased development complexity