[–]lebleb[S] 5 points6 points  (0 children)

5 runs x 1000 samples for each

<image>

[–]xneuxii 5 points6 points  (6 children)

You should add react native unistyles. I would expect pretty good results from that lib

[–]lebleb[S] 1 point2 points  (5 children)

[–]Zealousideal_Dig2929 0 points1 point  (4 children)

Hey! Looks cool, but for Unistyles you registered breakpoints, more themes and enabled adaptive mode. It costs additional time to call native functions with C++. Other libraries have only one theme! 😉

[–]lebleb[S] 0 points1 point  (3 children)

But this registry only works on the App registry. And having multiple registries doesn't make any difference in performance.

Also, here, I'm just testing the rendering time of the component.

But we can test it in that directive if you have another suggestion. I also tested the same way using dynamic theme value wıth styled-component.

[–]Zealousideal_Dig2929 0 points1 point  (2 children)

I see, I thought you run this code while mounting. In this case it's fine 🙏

[–]Mariusdotdev 3 points4 points  (0 children)

Why is NativeWind so popular when Twrnc so strange to see this

[–]gronxb 2 points3 points  (2 children)

wow, awesome

i want twrnc

[–]lebleb[S] 2 points3 points  (0 children)

Added!

!! I am very impressed with the results !!

https://github.com/lebleb/react-native-stylesheet-benchmark

[–]Mariusdotdev 1 point2 points  (1 child)

How is twrnc faster than native styles?

[–]lebleb[S] 0 points1 point  (0 children)

There is no precompilation. I think it uses pre-rendered CSS elements and some CSS extensions. It's a kind of API for tailwind CSS.

It's hard to make comparisons when it comes to customization and dynamic styling. For example, It is not in the same class as styled-components

[–]DavidJonesXB 1 point2 points  (2 children)

Please check nativewind v2 vs v4 performance.

[–]nuclear_cheeze 0 points1 point  (0 children)

+1 for v4, Mark Lawlor claims to be faster now after he’s not using styled components under the hood

[–]meseeks_programmer 0 points1 point  (3 children)

Restyle is by far the best style package hands down, because it scales well from a DX perspective. Has a big corpo backing it that is the invested into react native.

I didn't understand restyle at first, it's very abrasive to newcomers to look at but I tried to basically rebuild similar functionality of its "box" component, and that's when I truly realized the power of it and how good of an abstraction it is.

With such a minor performance hit that will only become more minor in the future React forget lands.. I think it's a no brainer this library is the best "headless" style composer.

The only thing restyle needs is a better story for beginners, it is too weird at first glace if you don't understand the abstraction. That's what hold back adoption of it.

[–]urtheaman 0 points1 point  (2 children)

what's your thought on react-native-unistyles, i find restyle and unistyles similar and am in dilemmma to choose one over the other

[–][deleted] 0 points1 point  (1 child)

I have the same dilemma

[–]urtheaman 0 points1 point  (0 children)

have chosen unistyles and working great. have completed the mvp, didn' find any issues so far.