Re: [xml] Read only XML tree

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


Just wondering. At the moment when you parse a 
document you can get multiple instances of the 
same "text" for example
--- tree fragment ---
  <node someattribute="1" />
  <node someattribute="1" />
------- 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 Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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