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
Ember.Select is slow with many options (~200) #633
Comments
One problem, you aren't escaping the values. var escape = Handlebars.Utils.escapeExpression escape(get(this, "prompt")) |
Yes, good point! Thanks |
I don't think @sandstrom What version of Ember are you using? |
@ebryn I'm using 0.9.5 |
@sandstrom Now that 0.9.6 is out can you give that a try? |
Only have a few minutes now, but I took a quick look and Ember.Select with 200 options is faster in 0.9.6 (don't have time to benchmark, so I don't know by how much). However, still not the instantaneous feeling the the hack above gives. But then, generating 200 views isn't something that one does often, select labels seems like an exception. |
Aside from the lack of escaping, I don't think what you did is a hack. It is just unbound, I do stuff like this as needed in app code, but it not responding to changes is too surprising to be a replacement for the general purpose control. |
Yes, I agree. Maybe re-generating all options if one of them changed (e.g. an @each observer), or just close since the performance improvements in 0.9.6 has mitigated this problem. |
@sandstrom I will close this for now. We do have some other ideas for performance improvements that are on our radar. |
Ember.Select
is fairly slow with many options, say a country select with 199 countries to choose from.It's slow because 200 views are created, one for every option. This is useful if the underlying collection changes, because changes are reflected. But typically select options are static.
The following code solves the problem, with the drawback of static options. Is this something you would like to include? If so I'll open a pull request.
Also, please let me know if you have any improvement suggestions.
The text was updated successfully, but these errors were encountered: