GVDV opened a new pull request, #82:
URL: https://github.com/apache/freemarker/pull/82

   I had a problem when using Freemarker with xml 's containing large content ( 
> 600KB)
   The number of nodes were high, more then 10 000 and when using String 
concatenation as in the following snippet the performance was/is very poor.
   
    _if (nodeType == Node.ELEMENT_NODE) {
                   String msg = "Only elements with no child elements can be 
processed as text."
                                + "\nThis element with name \""
                                + node.getNodeName()
                                + "\" has a child element named: " + 
child.getNodeName();
                   throw new TemplateModelException(msg);
               } else if (nodeType == Node.TEXT_NODE || nodeType == 
Node.CDATA_SECTION_NODE) {
                   result += child.getNodeValue();
               }_
   
   For a xml file of 600kb this took 6 to 11 seconds to process.
   When using a StringBuilder this takes 60 ms.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to