New faster SelectBox.js
|Reported by:||Graham King <graham@…>||Owned by:||adrian|
|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)
Changed 10 years ago by Graham King <graham@…>
comment:5 follow-up: ↓ 6 Changed 9 years ago by SmileyChris
- Patch needs improvement set
- Triage Stage changed from Unreviewed to Accepted
comment:8 Changed 9 years ago by Graham King <graham@…>
- Resolution set to duplicate
- Status changed from new to closed