I'm trying to use chosen.js for a list with about 1400 entries. It is taking about 1.5 seconds to run the initialisation code for chosen.
Have tracked down that in SelectParser.prototype.add_option()
the slow part is html: option.innerHTML
this.parsed.push({
array_index: this.parsed.length,
options_index: this.options_index,
value: option.value,
text: option.text,
html: option.innerHTML, // <======= here
selected: option.selected,
disabled: group_disabled === true ? group_disabled : option.disabled,
group_array_index: group_position,
classes: option.className,
style: option.style.cssText
});
If this is set to simply html: option.text
the chosen plugin still seems to work as required.
Are there other implications to changing this & any other tips to improve performance?