Comments (2)
如果想通过比较连续两次值是否相等来过滤掉其中一次无意义的更新操作所带来的成本是很大的,因为属性的值可能会是对象、函数、数组等复合对象,要想对它们进行值的比较是很困难的。
用 ===
比较过滤相同值完全没问题,getter/setter
的问题不在这,在于的一点比如如果需要获取 oldValue 的话才是比较费成本的操作。
from deep-in-vue.
这里其实想表达的是同一个意思,值的比较主要是针对原子类型来的,对象的直接比较是没什么意义的,对象存储的是引用而不是值,所以如果对一个响应式对象进行重新赋值后,所需要对对象进行的处理以及计算与原有对象相比对页面的影响这一步的成本是很大的。
from deep-in-vue.
Related Issues (12)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deep-in-vue.