You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2002/04/22 23:24:56 UTC

DO NOT REPLY [Bug 8381] New: - XMLScanner performance fixes

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8381>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8381

XMLScanner performance fixes

           Summary: XMLScanner performance fixes
           Product: Xerces-C++
           Version: 1.7.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Miscellaneous
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: David_N_Bertoni@lotus.com


XMLScanner is spending time creating unnecessary objects, or creating objects 
that are unused because they are not scoped correctly.  In particular, 
XMLScanner::scanRawAttrListforNameSpaces() creates an unused QName for each 
attribute, which results in unnecessary calls to new and delete.  There are 
also some unused local variables, and other variables which could be better 
scoped.  Here's a patch:

cvs diff XMLScanner2.cpp (in directory V:\xml-xerces\c\src\xercesc\internal\)
Index: XMLScanner2.cpp
===================================================================
RCS file: /home/cvspublic/xml-xerces/c/src/xercesc/internal/XMLScanner2.cpp,v
retrieving revision 1.5
diff -r1.5 XMLScanner2.cpp
782d781
<     States curState = InContent;
784d782
<     bool firstNonWS = false;
1315,1318d1312
<     //  Schema Xsi Type yyyy (e.g. xsi:type="yyyyy")
<     XMLBufBid bbXsi(&fBufMgr);
<     XMLBuffer& fXsiType = bbXsi.getBuffer();
< 
1332d1325
<         const XMLCh* valuePtr = curPair->getValue();
1335,1337d1327
<         QName attName(rawPtr, fEmptyNamespaceId);
<         const XMLCh* suffPtr = attName.getLocalPart();
< 
1343a1334,1335
> 			const XMLCh* valuePtr = curPair->getValue();
> 
1355a1348,1352
>         //  Schema Xsi Type yyyy (e.g. xsi:type="yyyyy")
>         XMLBufBid bbXsi(&fBufMgr);
>         XMLBuffer& fXsiType = bbXsi.getBuffer();
> 
>         QName attName;
1360d1356
<             const XMLCh* valuePtr = curPair->getValue();
1363c1359,1360
<             QName attName(rawPtr, fEmptyNamespaceId);
---
>             attName.setName(rawPtr, fEmptyNamespaceId);
> 
1365d1361
<             const XMLCh* suffPtr = attName.getLocalPart();
1369a1366,1368
> 
>                 const XMLCh* valuePtr = curPair->getValue();
>                 const XMLCh* suffPtr = attName.getLocalPart();

*****CVS exited normally with code 1*****

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org