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

Performence #85

Closed
andriijas opened this issue May 19, 2013 · 8 comments
Closed

Performence #85

andriijas opened this issue May 19, 2013 · 8 comments

Comments

@andriijas
Copy link

There are some performence issues with bootstrap-multiselect when you have a lot of options.

The refresh method for example which needs to match options with li in an inefficient way but simple way.

I dont have any concrete solution at this late sunday hour but lets try to discuss some possible solutions.

One way could be to build up internal data structures so that we dont need to check the dom for every item all the time which is time consuming.

We could also look at how chosen or select2 handles performence.

My first thought is that we could use the index passed to .each because there should be the same amount of option as li elements, except for those added by multiselect (filtering), if we can use the index we can make quick initial performence boosts ($('option', this.select)[index])

Thanks for creating bootstrap-multiselect!

@andriijas
Copy link
Author

Initial findings shows that $foo.multiselect('rebuild') is much faster than $foo('refresh') , perhaps for "select all" we can just toggle the select options and then rebuild the dropdown to make it faster?

@davidstutz
Copy link
Owner

Yes with large option lists we are running in performance issues anyway. But before tackling this problem we have to make the plugin a bit more modular. Caused by a lot contributions (do not misunderstand me, contributing is really great!) the complexity has risen to a point at which extending the plugin has become really difficult.

So I am currently trying to get a modular structure, and I would propose discussing the efficency with the new structure.

@andriijas
Copy link
Author

Sounds like a legit and reasonable approach! Thanks for your update!

@PaulMooij
Copy link

probably we'll use this component for a new web-app, but probably we'll have large lists.
from which number of items do you define a list as a large list?
so from which number of items is performance starting to be an issue?
100/1000/10000?

what's the planning for the new structure?

thanks for reply!

@davidstutz
Copy link
Owner

Without using the "select all" option performance should not be a problem up to 1000 options I think (500 options is still running relatively smooth, see the 4. demo here: http://davidstutz.github.io/bootstrap-multiselect/). But as you can try yourself the select all option with 500 items sometimes takes up to 10 seconds to complete. This is really bad and you can make suggestions how to improve performance on this issue. Maybe you will find a better solution, I appreciate any kind of pull request.

I started just expermineting a bit (I dont know if the beta is still in the current release), but due to my exams I will not be able to continue this at the moment. I plan to continue it around september, maybe october, but I do not know how much time I am able to invest. In addition there is still a bunch of work to do for the current version before starting with a "clean" approach.

@PaulMooij
Copy link

Hi David, thanx for the reply!
we'll look into it.
succes with your exams

@davidstutz
Copy link
Owner

#192

@PraveshShokeen
Copy link

Hi David
I used bootstrap multiselect with SelectAllOption .
there have 148 list items in dropdown .
it's working so slow .
Have you any solution of this problem.

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