|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: efficient xml programming technique
> -----Original Message----- > From: Haresh Gujarathi [mailto:gharesh@v...] > Sent: 26 September 2001 17:15 > To: Xml-Dev > Subject: efficient xml programming technique > > [...] > a. > I am little concerned since for each request the DOMParser object > is created and DOM processing is done. > (Well certain cases I can use SAX. But for time being let's assume, that I > must use DOM) Are you sure that creating the DOMParser is really eating up much resources/slow to do? I'd suspect most of the resource allocation is going into the DOM tree which you'll probably end up throwing away anyway even if you do cache parsers. In a previous application I did reuse parsers between requests (xml4j) but found that the parser didn't recover properly from parse exceptions (led to some interesting errors), so I ended up re-creating the parser each request. Didn't seem to add much overhead. > b. In the same application I have another scenario; > In the JSP files I use xalan transformer object to perform XSL > transformation on certain xml data. Now this happens for each > JSP request. > > Is this a normal practice? > > how can this be made efficient/less memory foot print/less runtime memory > usage ? Cache the transforms, and where possible the XML data. e.g. JAXP Templates. Basically reduce the amount of parsing you have to do for each request, be that for a stylesheet, or the data you're transforming. HtH, L. -- Leigh Dodds, Research Group, ingenta | "Pluralitas non est ponenda http://weblogs.userland.com/eclectic | sine necessitate" http://www.xml.com/pub/xmldeviant | -- William of Ockham
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








