Le jeudi 14 octobre 2010 à 11:14 -0700, David Lutterkort a écrit : 
> On Mon, 2010-10-04 at 08:37 -0400, Francis Giraldeau wrote:
> > Attached is a first draft of a patch for getting the node position,  
> > namely indexes of label and value of a node in the input file. The  
> > idea is to be able to highlight those in a UI.
> 
> Very nice idea ... is anybody working on a UI that uses this
> information ?

I started from the python gtk GUI that David Malcom posted on the list
few time ago, and added the highlighting as a proof of concept. 

http://multivax.blogspot.com/2010/10/augedit-regedit-for-linux.html

> 
> I suspect there's another pair of positions you want ot keep track of:
> the 'span' of the tree for interior nodes

Yes, that would be awesome. 

> The one thing that makes me a little hesitant committing this right away
> is that it increases the size of a tree node from 48 bytes to 64 bytes
> (and possibly more) for every user of Augeas, even though most of them
> won't make use of the position information.
> 
> Moving position information into a separate struct would lower the
> impact somewhat for people that do not need position information, since
> we'd just not allocate position information for them. Your strategy for
> memory management sounds right, the position information should live
> exactly as long as the struct tree.

So, we could add an option to keep node positions, and allocate the
structs only on demand? 

> 
> My memory size concerns might not really matter - it's been a while
> since I looked how much memory Augeas uses and for what. I know that the
> regexp matcher is very memory hungry, but that memory is only used
> transiently, whereas the tree generally sticks around for the lifetime
> of a struct augeas.

I did the test, and here is the results, as shown in statm of the
process of augtool after loading completed on a : 

Memory with indexes    : 12386
Memory without indexes : 11828

So, it's about 550k of RAM, or 5% increase. I would say that it's
resonable, especially if it's only triggered by some option.

Cheer, 

Francis


_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to