Best practice for filtering items client-side with JavaScript, hide or remove from DOM?
I have a relatively large dataset of items (a few thousand items) that I want to navigate by applying a number of filters client side in a web application. Applying the filtering logic itself is not an issue, the question is about which method to use for updating the table of matching results to get the best user experience. The methods I've come up with are:

1. Setting the class of each row to hide or show it (using visibility: collapsed to hide it), and keeping the DOM element in the table.
2. Keeping a DOM element for each data item, detaching/attaching it to the table to hide and show it.
3. Just keep an abstract object for each data item, creating a DOM object on demand to show it.

Which one is likely to give the best user experience? Any other recommended method besides those I've listed already?
Best practice for filtering items client-side with JavaScript, hide or remove from DOM?
===

I have a relatively large dataset of items (a few thousand items) that I want to navigate by applying a number of filters client side in a web application. Applying the filtering logic itself is not an issue, the question is about which method to use for updating the table of matching results to get the best user experience. The methods I've come up with are:

1. Setting the class of each row to hide or show it (using visibility: collapsed to hide it), and keeping the DOM element in the table.
2. Keeping a DOM element for each data item, detaching/attaching it to the table to hide and show it.
3. Just keep an abstract object for each data item, creating a DOM object on demand to show it.

Which one is likely to give the best user experience? Any other recommended method besides those I've listed already?