fdi files device syntax

Kay Sievers kay.sievers at vrfy.org
Tue Jul 25 06:28:20 PDT 2006


On Sun, 2006-07-23 at 09:48 +0100, Richard Hughes wrote:
> On Sun, 2006-07-23 at 07:59 +0200, Kay Sievers wrote:
> > On Sat, Jul 22, 2006 at 11:24:22PM +0100, Richard Hughes wrote:
> > > On Sat, 2006-07-22 at 11:18 -0400, David Zeuthen wrote:
> > > > And Kay already got a patch for this....
> > > 
> > > Was this cc'd to the mailing list or is it early-stage stuff? I've
> > > played for a couple of hours this evening, saving the xml data to a
> > > n-ary tree and it's much quicker[1]:
> > > 
> > > Adding the FDI files[2] and compiling to a n-ary tree : 20ms
> > > Checking for applicable rules after adding a device : 4ms
> > > 
> > > For reference the scan-every-file-every-time way of doing this takes
> > > about 75ms, although it's not a fair comparison as my experimental n-ary
> > > tree has too little error checking.
> > > 
> > > Kay, what was your method of caching and storing the tree?
> > 
> > The xml file is transformed into a linear match/action list, which just
> > jumps to the end of a block if the condition of the actual block is not
> > matching.
> 
> Gotcha, thanks. Wouldn't it be quicker still to use a tree based system,
> something like:
> 
> static void
> hald_fdi_merge_recurse (HaldFdi *fdi, HaldDevice *device, GNode *node)

...

> Then you don't have to go thru the gslist every time you want to skip a
> match block. Or am I missing something obvious?

What do you mean? You match and enter the block - or you jump over it. 

You go through only one list from the start to the end for all fdi
files, but you look only at the list entries inside of a matching block,
cause of we jump directly to the next block, if the match fails.

Kay




More information about the hal mailing list