Giter Club home page Giter Club logo

Comments (2)

tangbc avatar tangbc commented on June 20, 2024

如果想通过比较连续两次值是否相等来过滤掉其中一次无意义的更新操作所带来的成本是很大的,因为属性的值可能会是对象、函数、数组等复合对象,要想对它们进行值的比较是很困难的。

=== 比较过滤相同值完全没问题,getter/setter 的问题不在这,在于的一点比如如果需要获取 oldValue 的话才是比较费成本的操作。

from deep-in-vue.

xiaofuzi avatar xiaofuzi commented on June 20, 2024

这里其实想表达的是同一个意思,值的比较主要是针对原子类型来的,对象的直接比较是没什么意义的,对象存储的是引用而不是值,所以如果对一个响应式对象进行重新赋值后,所需要对对象进行的处理以及计算与原有对象相比对页面的影响这一步的成本是很大的。

from deep-in-vue.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.