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:
fre:
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.
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.
Discussion (23)
Another JS library? Please everyday there are new. I do not even bother to read about them anymore
It's ok. fre has been a framework for three years, but I am in China and rarely promote it.
At least it's Fre
He's been working on this for years - I've been following the development closely, because it's actually an interesting project, for two reasons:
It reimplements the React API, but with functional components first and only - if that's all you need or want, trying this could be interesting.
It uses a proper render scheduler - meaning, it does not block CSS animations etc. while rendering large chunks of content.
It's not really a "new library" in that sense - it's more in the category with Preact, an alternative React runtime. But it is substantially and fundamentally different from Preact, which could make it an interesting alternative for people building highly interactive applications where responsiveness is key - or perhaps just those who favor functional components and hooks, and want a smaller and faster runtime for some reason.
It might not be for you, personally - but this is not some random little "library of the hour", and it has substantially different qualities and goals from other alternative React runtimes.
You should not dismiss it so easily.
thank you! with my ♥
Rude. Instead you prefer to comment.
In fact, this is very few, I rarely comment abroad.
Sorry. I meant Andres Mosquera.
I am sorry but I have been a pro JS developer for more than 5 years and this is becoming exhausting already, even I am already a JS specialist and everyday find new info and patterns.
It's okay, it's okay.
Agreed. Instead of creating new framework and library every month ,it would be better to improve existing ones out there.
The existing framework cannot be improved, because it involves the core algorithm, if it is not designed from the beginning, it will not be able to be modified later
This is quite interesting.
Not just performance, according to GitHub repo: bundle size too.
Can you also write a comparison of features to other frameworks? (This looks so similar to react. Good thing for not having to learn yet another framework)
comparison is here
github.com/yisar/fre#compare-with-...
It's not really a huge thing to be faster than React. It would be a huge thing to be faster than React and offer a compatible developer experience.
Svelte is also faster than React but I found it a bit more troublesome to try and use it to update a legacy webapp piece by piece.
Fre can provide the same mental model as React, but I can't be compatible with React.
Fre is also 1000% less popular
Yes yes, haha
This does look very fast, and I liked that its almost the exact same API as React. Can you please add the way which the benchmark was calculated?
look at here github.com/yisar/fre/blob/master/d...
Thanks
我很开心看到这个projects I will save it now and see how I can help I'm not developer but I can invest with you if you are interested you can invite me in weixin : d-o999 and we can see what should be do
my weixin account is
shibuyayuri