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

Performamce Issue - 'update' loop when sliderPerView is auto and slides have fixed widths #7503

Open
5 of 6 tasks
mattwills8 opened this issue Apr 30, 2024 · 0 comments
Open
5 of 6 tasks
Labels

Comments

@mattwills8
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://github.com/mattwills8/swiper-perf-issues-repro/tree/main

Bug description

When slides per view is set to 'auto', and my slides have a fixed width, I'm seeing the swiper 'update' function run multiple times on the window 'load' event. In my production app this is creating a long blocking task, sometimes up to multiple seconds, and is causing significant performance issues.

Here's a screenshot from a profile of my app.
Screenshot 2024-04-30 at 13 15 46

Zooming in we see a huge number of swiper 'update' calls.
Screenshot 2024-04-30 at 13 16 35

In the minimal repro repo I've attached here, you can see a similar 'update' and 'load' loop (although for some reason split into separate tasks... that could be a framework related difference?).

It seems like having a carousel with fixed width slides like my example should be one of the most basic uses of a carousel for a responsive site, so it's entirely possible that I'm doing something wrong in my usage of it.

Any help would be hugely appreciated.

Expected Behavior

No response

Actual Behavior

No response

Swiper version

11.1.1

Platform/Target and Browser Versions

macOS Chrome

Validations

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

Would you like to open a PR for this bug?

  • I'm willing to open a PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant