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

setValue([]) Performance Degradation #306

Closed
jeff-mccoy opened this issue Feb 26, 2014 · 2 comments
Closed

setValue([]) Performance Degradation #306

jeff-mccoy opened this issue Feb 26, 2014 · 2 comments

Comments

@jeff-mccoy
Copy link

Whenever I call setValue with an array of values, Selectize takes 200-300 ms per value on the latest version of Chrome on an i7 Mac. After doing a little digging, it seems that 90% of the execution time is the call to refreshOptions().

Is there any negative side effect in skipping this call until the last element of the array? It seems to have worked for me and cut a 10 second call down to 300 ms. Thanks!

Line 662:

for (var i = 0, n = items.length; i < n; i++) {
    this.isPending = (i < n - 1);
    this.addItem(items[i]);
}

Line 1263:

if (!self.isPending) {
    self.refreshOptions(self.isFocused && inputMode !== 'single');
}
@jeff-mccoy
Copy link
Author

I forgot to close this before; 0.9.0 fixed this issue, thanks!

@brianreavis
Copy link
Member

Oops, I missed this too – no worries. Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants