swiper icon indicating copy to clipboard operation
swiper copied to clipboard

Preloader CSS animation on Lazy module causing heavy CPU usage

Open aynzad opened this issue 3 years ago • 2 comments

Check that this is really a bug

  • [X] I confirm

Reproduction link

https://swiper-lazy-load-images-react-heavy-cpu-usage.vercel.app/

https://github.com/aynzad/swiper-lazy-load-images-react-heavy-cpu-usage

Bug description

When Swiper with Lazy Images module is used, CPU usage is always high on the page even when there is no activity.

There will be a major issue when a page contains a lot of sliders using Swiper with lazy images that are using a lot of CPU power (in Chrome's Task Manager) and Style recalcs / sec, even when there is no activity.

Expected Behavior

On basic usage like pagination and scrolling, CPU usage and Style recalcs / sec should not be noticeable heavy. On idle (no activity) there should be minimum CPU usage with zero Style recalcs / sec

Screen Shot 2021-11-16 at 4 28 01 PM

Actual Behavior

On basic usage like pagination and scrolling, CPU usage and Style recalcs / sec are noticeable heavy. On idle (no activity) there is heavy CPU usage with continuously changing Style recalcs / sec

Screen Shot 2021-11-16 at 4 26 30 PM

Swiper version

7.2.0

Platform/Target and Browser Versions

macOS 12.0.1, Chrome 92.0.45, Safari 15.1

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • [X] Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • [X] I'm willing to open a PR

aynzad avatar Nov 16 '21 13:11 aynzad

Possibility related to this old issue https://github.com/nolimits4web/Swiper/issues/1451

aynzad avatar Nov 16 '21 13:11 aynzad

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 12 '22 14:06 stale[bot]

Swiper v9 doesn't lazy module anymore. If you have similar issues in Swiper 9, open a new issue with a CodeSandbox showing the issue.

nolimits4web avatar Feb 01 '23 11:02 nolimits4web