Tue 3 Nov
Generally, javascript itself is not a performance bottleneck. What kills it is the interaction with the DOM. Code that doesn’t touch the DOM rarely has performance issues. There are only rules of thumb here: interact with the DOM as rarely as possible, keep DOM complexity as low as possible, avoid repeated page reflows.
How does JavaScript memory work in browsers? - Stack Overflow.