From: Wolfgang M. M. <wol...@us...> - 2004-04-27 15:47:11
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28184/src/org/exist Modified Files: Indexer.java Log Message: * XQuery node construction consumed too much memory: instead of generating a SAX stream, nodes are now directly copied to the created output fragment. * QName objects are now created through the global name pool and thus shared between node objects. Index: Indexer.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/Indexer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Indexer.java 18 Feb 2004 10:15:23 -0000 1.6 --- Indexer.java 27 Apr 2004 15:47:01 -0000 1.7 *************** *** 38,41 **** --- 38,42 ---- import org.exist.dom.DocumentTypeImpl; import org.exist.dom.ElementImpl; + import org.exist.dom.NodeObjectPool; import org.exist.dom.ProcessingInstructionImpl; import org.exist.dom.QName; *************** *** 397,401 **** int p = qname.indexOf(':'); String prefix = p > -1 ? qname.substring(0, p) : ""; ! QName qn = new QName(name, namespace, prefix); if (!stack.empty()) { last = (ElementImpl) stack.peek(); --- 398,402 ---- int p = qname.indexOf(':'); String prefix = p > -1 ? qname.substring(0, p) : ""; ! QName qn = broker.getSymbols().getQName(namespace, name, prefix); if (!stack.empty()) { last = (ElementImpl) stack.peek(); *************** *** 479,486 **** p = attrQName.indexOf(':'); attrPrefix = (p > -1) ? attrQName.substring(0, p) : null; ! final AttrImpl attr = ! new AttrImpl( ! new QName(attrLocalName, attrNS, attrPrefix), ! attributes.getValue(i)); attr.setOwnerDocument(document); if (attributes.getType(i).equals("ID")) --- 480,486 ---- p = attrQName.indexOf(':'); attrPrefix = (p > -1) ? attrQName.substring(0, p) : null; ! final AttrImpl attr = (AttrImpl)NodeObjectPool.getInstance().borrowNode(AttrImpl.class); ! attr.setNodeName(document.getSymbols().getQName(attrNS, attrLocalName, attrPrefix)); ! attr.setValue(attributes.getValue(i)); attr.setOwnerDocument(document); if (attributes.getType(i).equals("ID")) *************** *** 489,492 **** --- 489,493 ---- if (!validate) broker.store(attr, currentPath); + attr.release(); } } |