Fyrd / purejs-datalist-polyfill

A pure JS (no jQuery required) implementation of the HTML5 datalist element
MIT License
60 stars 41 forks source link

Perf issues #3

Open yinxie opened 7 years ago

yinxie commented 7 years ago

Nice work guys!.I have tried to use it for a list with a few hundreds of items. On a quad core Xeon, it took a second or more to create the list. I have done some profiling and optimization, now it is more than reasonable.

1) pull the query.tolowercase outside of the loop, there is no need to repeat that 2) precompute tolowercase for each item and cache them 3) append a child to a datalist is very slow, do that on a DIV, this package will still work if one doesn't care about the native support of datalist.