tokkozhin / react-native-neomorph-shadows

Shadows and neumorphism/neomorphism for iOS & Android (like iOS).
MIT License
808 stars 94 forks source link

its too slow #4

Closed 92sajid110 closed 4 years ago

92sajid110 commented 4 years ago

hello, Its too slow when navigating to other screen it takes 4-5 secs to navigate other screen. I think this is running in js thread thats why its lag. This is useful only for small projects without navigation But its great i make great ui but again due to performance now i am moving to native

hadnet commented 4 years ago

Yeah... on iOS is not really that low, it takes 1-2 seconds to navigate to another screen. On Android it takes much time indeed (3-4s). I will ask @msand from react-native-svg if there is a way to optimize this.

jantongiovanni commented 4 years ago

(On Android) Same problem for ScrollView, sits at around 15 fps when scrolling with a few Neomorph Boxes. Adding renderToHardwareTextureAndroid to the parent view improves performance slightly, to about 20 fps

https://facebook.github.io/react-native/docs/performance#moving-a-view-on-the-screen-scrolling-translating-rotating-drops-ui-thread-fps

92sajid110 commented 4 years ago

Yeah... on iOS is not really that low, it takes 1-2 seconds to navigate to another screen. On Android it takes much time indeed (3-4s). I will ask @msand from react-native-svg if there is a way to optimize this.

Please optimize this for android sir i am awaiting

92sajid110 commented 4 years ago

it is possible to cache component because mainly same component renders for optimization in android

georgeMorales commented 4 years ago

The library is very good, you can make very beautiful designs but it is very slow. Why some shadows makes the app so slow, there is no animation? Thank you!

Fulanko commented 4 years ago

The react-native-svg readme mentions that absolute values in LinearGradient have better performance than percentages. Maybe that can help here?

92sajid110 commented 4 years ago

Any update about this

tokkozhin commented 4 years ago

@Fulanko I'll try to check it out. But even if it's true, I doubt it'll significantly improve performance...

msand commented 4 years ago

Probably the performance is due to the graphics rendered rather than percentages. To have a significant difference, would need to achieve the same thing with cheaper primitives. Should profile and see what takes the most time, if you want to know what makes sense to try changing.

msand commented 4 years ago

Should probably remove that comment, several years old and probably not measurable difference.

yacineblr commented 4 years ago

Any update please ? I tried in android "release" mode with several elements (+15), the change of page to its elements is extremely slow.

rodgomesc commented 4 years ago

not solved yet?

yacineblr commented 4 years ago

not solved yet?

I haven't found a solution or an alternative.

msand commented 4 years ago

Did you try profiling it in Android studio and XCode? Try to find the parts that take the most time to render/process, and deduce how you can achieve the same/similar end result, but using less computations.

sagarrs commented 4 years ago

one of the best package for neumorphic designs. The UI created using this is awesome but is very slow, i am planning to use this in production only if the performance issue gets resolved soon.

tokkozhin commented 4 years ago

I'm afraid it can’t to get more performance now. This is a temporary solution, and not for a large number of objects. perhaps if there is a possibility to change something, then it certainly will not give a significant increase.

It is possible to simplify calculations and the quality of shadows will be greatly decreased, but even then the performance will not increase much.

So if anyone has ideas, I'd be glad to hear them...

yacineblr commented 4 years ago

Is there an android application (native) using this design? Can we reproduce this design in java?

tokkozhin commented 4 years ago

@yacineblr Yes, of course it would be better if the same algorithm was implemented natively on the android. Unfortunately, I’m not the android developer(

yacineblr commented 4 years ago

I found this library, unfortunately I'm not a java developer, so I can't reproduce this on a blank android app. https://github.com/4inodev/Neomorphic-FrameLayout-Android

tokkozhin commented 4 years ago

@yacineblr, thanks for help) I think I've found a solution. There's gonna be a new release soon with breaking changes.

rodgomesc commented 4 years ago

@yacineblr, thanks for help) I think I've found a solution. There's gonna be a new release soon with breaking changes.

oh my god, i'm extremely excited with this lib

yacineblr commented 4 years ago

Well done @tokkozhin , I can't wait !  👏

KoreanThinker commented 4 years ago

@yacineblr, thanks for help) I think I've found a solution. There's gonna be a new release soon with breaking changes.

I'm waiting too!

moh3n9595 commented 4 years ago

Same issue!

SachArora commented 4 years ago

@tokkozhin I'm waiting

tokkozhin commented 4 years ago

Check out the new release!

92sajid110 commented 4 years ago

I think problem solved. Well i will try in navigation did it works well or not. But good library and well support. Thanks @tokkozhin

rodgomesc commented 4 years ago

But good library and well support. @92sajid110

the core of the library as migrated from tn-svg to rn-art , and it's more performant for anything that animates because it doesn't pass the entire surface through SVGKit each time