GithubHelp home page GithubHelp logo

a145789 / object-defineproperty-vs-proxy Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 100 KB

Object.defineProperty vs Proxy

Home Page: https://a145789.github.io/object-defineproperty-vs-proxy/

HTML 2.16% JavaScript 96.05% CSS 1.79%
proxy vue3

object-defineproperty-vs-proxy's Introduction

Object.defineProperty vs Proxy

在线测试地址:https://a145789.github.io/object-defineproperty-vs-proxy/

创建响应式,Proxy 性能更好

运行 100 次 运行 1000 次 运行 10000 次 运行 100000 次
Proxy 0.10 ms 0.30 ms 0.50 ms 5.00 ms
defineProperty 0.30 ms 1.20 ms 12.00 ms 145.50 ms

对响应式对象的读写性能,Object.defineProperty 性能更好

运行 100 次 运行 1000 次 运行 10000 次 运行 100000 次
Proxy 0.10 ms 0.80 ms 4.40 ms 28.40 ms
defineProperty 0.00 ms 0.40 ms 1.80 ms 18.0 ms

深度监听,二者差不多

运行 100 次 运行 1000 次 运行 10000 次 运行 100000 次
Proxy 0.00 ms 0.30 ms 3.40 ms 32.40 ms
defineProperty 0.00 ms 0.40 ms 2.80 ms 30.90 ms

参考 https://github.com/y-temp4/object-defineproperty-vs-proxy.git/

object-defineproperty-vs-proxy's People

Contributors

a145789 avatar

Watchers

 avatar

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.