Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize memory usage by dropping dotLottie file buffer from memory #221

Open
theashraf opened this issue Aug 28, 2024 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@theashraf
Copy link
Member

We are currently storing both the dotLottie file buffer and the deflated Lottie JSONs in memory. This approach results in double the memory consumption, which is inefficient, especially when working with large animations or in resource-constrained environments.

Short-term solution:
Cache all the assets in the provided dotLottie file and then remove the dotLottie file from memory. This approach should work well for users who are using a single animation dotLottie file and do not require themes or state machines in the future. This is the most common use case for the majority of users since the creation tools on LottieFiles do not yet support multiple dotLottie animations, theming, or state machines.

Long-term solution:
Implement inversion of control by allowing users to provide a list of assets they want to cache upfront, which they may or may not use in the future during load time. This would enable users to optimize scenarios where they might use a single or a few assets on one platform but a different set of assets on another platform.

Related issue: LottieFiles/dotlottie-ios#33

@theashraf theashraf added the enhancement New feature or request label Aug 28, 2024
@theashraf theashraf self-assigned this Aug 28, 2024
@theashraf theashraf changed the title Optimize memory usage by dropping dotLottie file from memory Optimize memory usage by dropping dotLottie file buffer from memory Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

1 participant