jquery.filter with a large array - SLOW, please help
Hello people,
I have an array of tr elements each uniquely identified by their id.
This array could be potentially very large (e.g, thousands in length)
var elem = $(tradePosTableNodes).filter('#'+id)[0];
It appears that when the filter function is called it takes a few good seconds and it also blocks the entire browser.
This happens when I have a list of ids i want their elements retrieved.
For example a scenario would be,
An array of 500 ids whose elements are stored in the tr array and need to be retrieved so that they can be updated.
Are there any alternatives to use to uniquely identify the right element by id, given a large array of elements?
I have also tried $.grep but it's even slower..
Again, this only occurs when the length of the array is 3000 and above.
Thanks and I appreciate your help
Regards,
A