Skip to content
Snippets Groups Projects
Commit b80f6879 authored by Tinny Ng's avatar Tinny Ng
Browse files

Performance Patches by David Bertoni.

Details: (see xerces-c-dev mailing Jan 14)
XMLRecognizer.cpp: the internal encoding string XMLUni::fgXMLChEncodingString
was going through this function numerous times.  As a result, the top hot-spot
for the parse was _wcsicmp().  The real problem is that the Microsofts wide string
functions are unbelievably slow.  For things like encodings, it might be
better to use a special comparison function that only considers a-z and
A-Z as characters with case.  This works since the character set for
encodings is limit to printable ASCII characters.

 XMLScanner2.cpp: This also has some case-sensitive vs. insensitive compares.
They are also much faster.  The other tweak is to only make a copy of an attribute
string if it needs to be split.  And then, the strategy is to try to use a
stack-based buffer, rather than a dynamically-allocated one.

SAX2XMLReaderImpl.cpp: Again, more case-sensitive vs. insensitive comparisons.

KVStringPair.cpp & hpp: By storing the size of the allocation, the storage can
likely be re-used many times, cutting down on dynamic memory allocations.

XMLString.hpp: a more efficient implementation of stringLen().

DTDValidator.cpp: another case of using a stack-based buffer when possible

These patches made a big difference in parse time in some of our test
files, especially the ones are very attribute-heavy.


git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@172497 13f79535-47bb-0310-9956-ffa450edef68
parent 8665d47b
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment