airbnb / lottie-android

Render After Effects animations natively on Android and iOS, Web, and React Native
http://airbnb.io/lottie/
Apache License 2.0
34.97k stars 5.4k forks source link

use generic on Float cause too many auto-boxing/auto-unboxing #211

Closed shifujun closed 6 years ago

shifujun commented 7 years ago

When I test my animation, I found Memory Churn. So I did some analysis roughly.And I found lottie use too many generic on Float. It cause auto-boxing/auto-unboxing frequently.

I think it is the top performance problem. I will try to solve it ,and hope author will fix it more gracefully.

2017-03-21 11 27 58 2017-03-21 11 27 41

gpeal commented 7 years ago

@shifujun This is something I've looked in to before. I wouldn't say it's a top memory problem because the GC can clean up after it quite easily. However, it would be a nice to have to eliminate.

gpeal commented 7 years ago

No need to close this. I'll look in to it :)

yumauesaka commented 7 years ago

image

I am seeing that with other primitives as well as (Integer for example, see above) I'm bumping this issue: @gpeal have you looked into resolving this?

Curwer-zz commented 6 years ago

@gpeal Any news on this issue?

gpeal commented 6 years ago

@Curwer This hasn't been a high priority issue for me. ART is pretty good at dealing with cleaning up autoboxing. Is this causing a significant performance hit for you?

gpeal commented 6 years ago

I haven't found this to add significant performance or memory overhead nor has it seemed to be an issue for anybody in production. If this is definitely an issue, I can spend some more time on it.