You do not need a template tracing mechanism - I do this all the time, and long before you run into something with an indefinitely heavy server, the browser will begin to choke. Rendering a row table of 10,000 will tie the processor in seconds in almost any browser; scrolling will be too intermittent in chrome, and mem browser usage will increase regardless of browser.
What you can do (and I previously implemented it, although this was not necessary in retrospect) is the client side xslt. Printing xslt processing instructions and opening and closing tags using strings is easy and fairly safe; then you can pass each individual line as a separate xml element using any xml writer technique you prefer.
However - you really don't need this and probably never will - if your html generator is too slow, the browser will be an order of magnitude more problematic.
So, if you have not compared this and determined that you really have a problem, do not waste your time. If you have a problem, you can solve it without fundamentally changing the method - memory generation may work fine.
source share