Details
Description
When serializing the DOM, ICEfaces currently builds a String internally and then writes the String to the writer. It would be more efficient (particularly on full page updates) to write the DOM directly to the writer.
Preserve the current API and pass a StringWriter to a new writeDOM() method that accepts a writer. The current implementation that makes use of stringBuffer.append() can simply be replaced with writer.write().
Issue Links
- blocks
-
ICE-3082 CPU performance/efficiency
- Closed
Incremental updates can also make use of the writer directly if the methods:
writeChildren(Writer writer, Node node)
writeNode(Writer writer, Node node)
are implemented (writeNode() is already necessary for the implementation of writeDOM).
The efficiency gain in this approach is largely from the fact that the memory consumption is bounded. In some cases, pooled strings will be passed to the writer directly and need not be copied into memory (buffering will result in copying, however).