Re: [xml] xmlbench Benchark results...



On Wed, 2003-03-19 at 14:48, Sander Vesik wrote:
if all (and i do mean absolutely all, except for a small amount of very 
trivial and limited cases) used ref counted strings, then you could replace
string compares with pointer compares.

I remember we went into this discussion with Daniel as well. But when I
say "string sharing" I don't think at all at reference counting, which
would imply to change libxml2 API and would make the C code an
unmanageable mess. If you do sharing uniformly, you simply know that
strings are shared in a centralized data structure that you can protect
with a write-only mutex (the critical section would be protected only
when creating a new element or attribute, so I presume this kind of
access quickly approaches zero after you've loaded your document and a
stylesheet). In order to deallocate strings that aren't used anymore,
you can associate to each string the list of documents using it, and
free the string as soon as this list becomes null (this is just an
example, there might be alternative ways of doing this).

Hope to find the time to investigate this further at some point.

-- luca






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