-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
Enhancement Request: Improve the performance of initialization of selectize (specifically the setValue() operation).
A use-case I have has me using many selectize controls (~50) on the same page that have different initial selected values (~10-250) but share the same options (~2500). The current initialization process uses the setValue() method which is desired, but this setValue() method inserts each item individually and does not extract operations which can be done in bulk (or at the end of the bulk operation). For example, setValue() calls addItem() for each item, and this method calls insertAtCaret() each time, and this method calls setCaret() which is very expensive. Commenting out this 1 setCaret() call can bring the runtime of initialization from 20745.976ms to 2842.559ms which is ~86% improvement. In this specific case it seems like it should be possible to delay the caret manipulation until after the data has been updated? There is likely other processing that can be delayed an updated at the end of the setValue() operation.