-
Notifications
You must be signed in to change notification settings - Fork 439
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
Improve performance for big Select #58
Comments
Hi @codesource, I'm already aware that appending to the DOM is slow and I think I happen the multiSelect container as late as I can. The first time I append something to the DOM happens at line 157 (https://github.com/lou/multi-select/blob/master/js/jquery.multi-select.js#L157). Before that, I manipulate elements that are newly created and which are not part of the DOM yet. I'm curious why your code is more performant. I know the plugin is not well suited for list with more than 1000 elements and I take this issue seriously. |
I added some comments and an other correction for select without ID. http://www.code-source.ch/files/jquery.multi-select-patch.js The reason comes from jQuery core. Each time you call "append" jQuery do more job than only append element to an other. Calling on a group of items avoids all these jobs each time. |
Hi guys, |
How about calling |
I'm fairly new to web dev, but my understanding is that the big pauses are On Tuesday, May 21, 2013, Ryan Buckley wrote:
|
if your seeing a pause when manipulating the DOM, odds are your not working on detached fragments. JavaScript is incredibly fast and looping through a few hundred (or thousand) items in an array isn't costly, however manipulating the DOM is, especially on older browsers. You could also look into WebWorkers for newer browsers |
I stand corrected, JS execution is a blocking operation, regardless of DOM manipulation. How about array chunking? Split the array into smaller chunks and have it call itself recursively with a |
Sending a "bump" here as well. See related issue: #101 |
I too would like a suggestion on how to solve loading a list of over 10,000 elements. Perhaps with some sort of ajax triggered pagination? |
Maybe open a bounty on stackoverflow? That might motivate me to come up with something... |
Hi guys, I have some problem, when i tried to load 2000 items selected, firefox return this message: too much recursion This problem occurs on these lines of code selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable').filter(':not(.'+that.options.disabledClass+')'), selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection').filter(':not(.'+that.options.disabledClass+')'), Can you help me ? |
I did a fork and added a pull request for that. You can try it. Firefox + Google chrome: Internet explorer: |
Ha super, it's work fine. Thank you very munch ... |
I used your plugin for select with many items (~3000).
Its works but take ~3mins to render with many FF warning about endless loop.
I did some modification and now it take ~6secs.
The idea is first to prepare all items before adding them to DOM.
The text was updated successfully, but these errors were encountered: