[Expat-bugs] [ expat-Patches-600964 ] Element name storage optimization

noreply@sourceforge.net noreply@sourceforge.net
Tue, 27 Aug 2002 13:46:35 -0700


Patches item #600964, was opened at 2002-08-27 16:04
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=310127&aid=600964&group_id=10127

Category: None
Group: None
>Status: Closed
Resolution: Accepted
Priority: 5
Submitted By: Karl Waclawek (kwaclaw)
Assigned to: Karl Waclawek (kwaclaw)
Summary: Element name storage optimization

Initial Comment:

Expat stores an element's "raw name" 
(=unconverted) as well as its encoded form.

Storage of the raw name can be optimized by
having the tag->rawName member point directly
into the parse buffer. However, this currently
is only done for the last buffer chunk, since
previous parse buffers are discarded.
So, most of the time raw names are stored in
a designated buffer, causing expensive memory 
allocations.

One can optimize this by only storing those
raw names in a separate buffer whose elements
are still open when the parse buffer is about to
be discarded. In other words, the raw names of 
elements that are opened *and* closed while
the same buffer is parsed are never stored,
since the life time of their raw names is shorter
than the life time of the parse buffer.

The attached patch (xmlparse.c.diff) tries
to achieve that.

Performance benefits should be most noticeable
for large XML documents that are not deeply nested.


----------------------------------------------------------------------

Comment By: Karl Waclawek (kwaclaw)
Date: 2002-08-27 16:46

Message:
Logged In: YES 
user_id=290026

OK, checked it in.
Hope you didn't just run tests, but checked
my code too.

----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-08-27 16:15

Message:
Logged In: YES 
user_id=3066

Works for me -- no objections to checking it in.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=310127&aid=600964&group_id=10127