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

Performance issues on refresh #806

Closed
sheeshmohsin opened this issue Nov 21, 2014 · 4 comments
Closed

Performance issues on refresh #806

sheeshmohsin opened this issue Nov 21, 2014 · 4 comments

Comments

@sheeshmohsin
Copy link

when using .selectpicker('refresh') on a huge list of items dynamically added to the dropdown, it takes a lot of time for refresh, the list is around of 5000 items or more. Please help someone to solving this performance issue.

@sheeshmohsin
Copy link
Author

It also hangs on applying to a dropdown having greater number of items, as i have around 10000 items in a dropdown.

@truckingsim
Copy link
Contributor

@sheeshmohsin this is going to be a problem with any drop-down replacement you use that doesn't use ajax. All the dropdown replacement plugins work by faking a dropdown. This one included.

For every option tag in your select, there are around 6 additional dom elements. So for your first list there is around 30k elements and for your second 60k. That's a lot to generate through javascript and update. No browser is going to handle this well in the near future.

I've written a plugin (link) that lets you implement an ajax search through the input that data-live-search creates. You can't load all 5k initially anymore, but you will still be able to use selectpicker and it will speed up everything. If you decide to use this and run into any problems make a new issue on that plugins page.

@enricosoft
Copy link

I have the same problem when try to refresh about 30 selects (without a lot of items inside), in particular on mobile devices. Hope this problem will be fixed asap cause this is a nice plugin

caseyjhol added a commit that referenced this issue May 5, 2015
Utilizes native Javascript DOM properties to improve render speed. Moves
liHeight function inside setSize so it only runs when the select is
opened rather than running it for every select on init.
@caseyjhol
Copy link
Member

Please try v1.7.0-rc2 and report back.

avantika-gupta-jtg pushed a commit to JoshLabs/bootstrap-select that referenced this issue May 14, 2020
…appointments#582)

Utilizes native Javascript DOM properties to improve render speed. Moves
liHeight function inside setSize so it only runs when the select is
opened rather than running it for every select on init.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants