[fpc-pascal]Searching a faster TXMLConfig

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Mar 11 01:06:16 CET 2002

On Sun, 10 Mar 2002 21:47:58 +0100 (CET)
Michael.VanCanneyt at wisa.be wrote:

> On Sat, 9 Mar 2002, Mattias Gaertner wrote:
> > Hi all,
> >
> > I already asked the for a faster TXMLConfig.
> > But before I implement a new one, I ask twice.
> >
> > TXMLConfig in xmlcfg.pp is a very easy component to handle config files.
> > Since these files are in xml, which is nowadays a format for everything, I wonder, if there are some other implementations, which do not linear searches.
> >
> > Can anyone give me a hint/link for other xml implementation?
> >
> > Maybe the DOM implementation can be enhanced with some dynamic hash tables?
> I think that this is the better approach; Improving the DOM implementation
> and thus the existing TXMLConfig is of more benefit to anyone. Do you know
> where the exact problem is ?

The childs of a DOM node are stored in a chained list. Accessing A/B/C will result in searching the childs of A for B and the childs of B for C.
This could be improved, when the first sibling or the parent contains an hash index or a sorted array. Of course this would slow down inserting a node behind another node. But since the user adds nodes via
A/B/C := Value this inserting operation does not appear. So, we can only gain.

> hash tables or so should not be hard to implement; But I would like this to
> be based on a more general hash class, if possible... We need that anyhow in
> the FCL.

Hmm, have to think about that ...

Mattias Gaertner

More information about the fpc-pascal mailing list