Re: [xml] Read only XML tree



On Fri, May 31, 2002 at 01:43:46AM +0000, k_isdale tpg com au wrote:

  Hi,

Just wondering. At the moment when you parse a 
document you can get multiple instances of the 
same "text" for example
--- tree fragment ---
 <doc>
  <node someattribute="1" />
  <node someattribute="1" />
 </doc>
------- end --------------
You get two copies of 'node', 'someattribute' 
and '1' 

If a document was guaranteed to be valid and to 
be treated as build once read many times what 
optimization are possible? Could there be a 
benifit of creating a pool of immutable strings 
that get shared (for node names, attribute names 
and attribute values)? It could be possible to 

  Well libxml was designed as a toolkit to load/modify/save markup
documents. So there is no optimizations for read-only ones.
  It also operates under the constraints that memory allocation 
can be delegated globally to an external layer, and changing radically
the allocation strategies may prove difficult (libxml3 maybe at some point)

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]