This content has been marked as final. Show 4 replies
In the case when user have very large set of folders or files, response time is getting increased a lot and thus causing performance degradation while displaying the user library tree.Expected behavior. More data, more processing time. Also XML and XSTL are very verbose, so the data involved that needs to be processed has lots of overhead.
Is there any other option so that I could load my tree faster.Don't display everything comes to mind. Use a more efficient manner of dealing with the content is a second. But first you have to investigate where the processing time is lost. Is it in forming the data, or is the browser which has to process the XSTL and the XML data to form the eventual view (likely HTML)?
s that concept of lazy loading helpful herePerhaps, if you mean loading child data only when a node is unfolded.
1 person found this helpful
While we display the folders and files for a particular user, we are forming the complete HTML string and then loading it into the browser. Is ther any performance tuning concept i can implement here?Yes, send the HTML to the browser as you create it, instead of creating it all first. You can pipeline the XML creation, XSLT transformation, and HTML writing so it all happens at the same time.
Thanks for the reply.
Could you please breifly explain the process of pipelining. As of now, this is what we are doing.
treeViewXMLBuilder.buildXMLTree(libraryTreeMap, timeZone, userAccessView, browser, dateFormat);
// Transforming XML to HTML
StringWriter writer = new StringWriter();
ByteArrayInputStream xmlInputStream = new ByteArrayInputStream(treeViewXMLBuilder.getTree().getBytes("UTF8"));
Source xmlSrc = new StreamSource(xmlInputStream);
Source xsltSrc = new StreamSource(SCFCConfig.getValue(SCFCConstants.XSLT_PATH));
Result htmlResult = new StreamResult(writer);
TransformerFactory tf = TransformerFactory.newInstance();
Templates cachedXSLT = tf.newTemplates(xsltSrc);
Transformer transformer = cachedXSLT.newTransformer();
the String that was returned finally was set to request object and in the JSP we are assigning it to the DIV using its id attribute.
Please let me know how I can Pipe line the processes you mentioned in the previous reply.