The solution is to improve the browser to remove the performance hit. Modern computers are extremely powerful so there is no good reason why they would not be able to handle a zillion things in the DOM.
A zillion things is more than a zillion bytes of RAM :p
The browser can easily handle millions of calculations and then render a million DOM elements so quickly that you won’t even notice it. The problem is when you try and do this hundreds of times very second.
The irony is that obsessing over smoothness and frames per second is what causes this in the first place.