7

Fre is 10 times faster than react!

 2 years ago
source link: https://dev.to/132/fre-is-10-times-faster-than-react-224k
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Fre is 10 times faster than react!

Aug 7

・2 min read

Recently, some people used react to find that rendering a large amount of data is particularly slow. They began to try fre and found that fre is 10 times faster on average than react!

Fre has been very fast. Frankly, I know react very well. I think the structure and algorithm used by the react team are not good enough within the framework, and they have not improved.

Let's look at the flame diagram.

react:

In this test, react defaults to synchronous mode and fre to concurrent mode, but in theory, the synchronous mode should be faster.

The time slice unit of fre is 16ms, which can finally be close to 60 FPS. There is an error in react. They think that the smaller the unit, the better, so that the unit of 5ms is too small and JS pressure is too high.

According to my experience, the advantage of vdom framework is that it has a better structure and can make better algorithms. Not only diff algorithms, but also offscreen algorithms.

But fre's algorithm is not the best. Maybe I will implement a better algorithm in fre3.

https://github.com/yisar/fre

If you are interested, you can see it.

Now I mainly do miniapps in the company. The rendering of miniapp uses fre.

Because this is a mobile architecture, I don't have much time to realize the fetures of PC side such as SSR, which is a pity.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK