New faster SelectBox.js
|Reported by:||Owned by:||Adrian Holovaty|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
Here is a new SelectBox.js that uses maps/objects where it used to use lists, changing the complexity of SelectBox.move from quadratic to
linear (and I thought big O notation was just for interview questions!). For example on a list of 4000 elements it now iterates 4000 times instead of up to 16 Million (4000*4000).
This also always displays the entries sorted alphabetically. This was, I _think_, the intention of the original SelectBox, but it wasn't happening in practice. Aside from this behaviour is identical to previous SelectBox.
Change History (10)
comment:5 follow-up: 6 Changed 10 years ago by
|Patch needs improvement:||set|
|Triage Stage:||Unreviewed → Accepted|