GithubHelp home page GithubHelp logo

Comments (2)

yisar avatar yisar commented on May 27, 2024 1

我回来了,你这个测试的是首屏的性能指标,首屏幕 fre 要比 vue/react 要慢的,原因如下:

  1. fre 默认开启时间切片,首屏幕默认也切片,也就是你说的 5ms 阈值导致的
  2. fre 为了 1kb 并没有区分 mount 和 update 逻辑,也就是说 fre 的 mount 默认也走 update 的 diff 算法,这个算法的时间复杂度是 O(logN),算法自身是不快的,而 react 和 vue,首屏 mount 阶段是不走这个 diff 的,直接 append

所以这个 benchmark 用例,fre 会更慢,但是如果你写一个复杂的更新逻辑的时候,react 则会变成最慢的那个

因为 fre 的 diff 算法本质上和 inferno/vue3 原理相同,fre 用的最长公共子序列,inferno 用的最长递增子序列,这基本上是最快的 diff 算法了

from fre.

yisar avatar yisar commented on May 27, 2024

fre 默认开启时间切片,所以这种同步测试会比较吃亏

from fre.

Related Issues (20)

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.