folofse / androw

Shadows in React Native for Android
97 stars 16 forks source link

experience performance issues #20

Open hejun041 opened 4 years ago

hejun041 commented 4 years ago

This is a very well implemented library that perfectly restores the shadow on Android

But when used in large quantities on a project, there are serious performance problems :( is there any solutions or ideas?

hejun041 commented 4 years ago

https://developer.android.com/reference/com/google/android/material/shape/MaterialShapeDrawable

folofse commented 4 years ago

Yes it uses Bitmap Rendering to simulate the shadows which can be performance heavy if multiple shadows and animations are rendered at the same time.

I have not found any other solution for Android so far that can apply to any component without faking the shadow with Bitmap Render.

msand commented 4 years ago

It not exactly faking it, more like actually calculating it 😉 It might be possible to do using OpenGL, or RenderScript, it might be more performant for some use cases, assuming it's adapted to the use case properly and the specific input fits the architecture.