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

per(web): move offscreen & partial rendering optimizations from the wrappers to dotlottie-web #277

Open
theashraf opened this issue Jul 3, 2024 · 1 comment
Labels
enhancement New feature or request web

Comments

@theashraf
Copy link
Member

to ensure performance consistency and feature parity among dotlottie-web wrappers, two performance optimizations were introduced in the dotlottie-web component wrappers only:

  1. Freezing and unfreezing the animation when it's offscreen and not visible to the user: This saves resources by pausing the animation when it's not in view.
  2. Rendering only the visible areas of the animations using the setViewport API: This optimization also saves resources by limiting rendering to the areas that are actually visible.

These two optimizations should be integrated into the dotlottie-web codebase to ensure consistency across implementations.

Changes:

Since these optimizations are performance and rendering related, they can be integrated into the RenderConfig of the DotLottie instance:

export interface RenderConfig {
  useRenderVisibleAreaOnly?: boolean; // default to true
  useFreezeWhenInvisible?: boolean; // default to true
  devicePixelRatio?: number;
}

These optimizations should be enabled by default, allowing users to disable them if needed through the setRenderConfig API.

@theashraf
Copy link
Member Author

related #273

@theashraf theashraf added enhancement New feature or request web labels Jul 3, 2024
@theashraf theashraf changed the title web: move offscreen & partial rendering optimizations from the wrappers to dotlottie-web per(web): move offscreen & partial rendering optimizations from the wrappers to dotlottie-web Aug 20, 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 web
Projects
None yet
Development

No branches or pull requests

1 participant