Re: AVL tree

2011-05-23 Thread Otto Moerbeek
On Mon, May 23, 2011 at 02:05:53PM +0100, Stuart Henderson wrote: > On 2011/05/21 00:19, Ariane van der Steldt wrote: > > I suspect that the PF state table is mostly lookups, therefor AVL would > > improve performance there. That said without having looked at the code > > though. > > Lots of writ

Re: AVL tree

2011-05-23 Thread Stuart Henderson
On 2011/05/21 00:19, Ariane van der Steldt wrote: > I suspect that the PF state table is mostly lookups, therefor AVL would > improve performance there. That said without having looked at the code > though. Lots of writes too, but in normal conditions the majority are to existing states rather tha

Re: AVL tree

2011-05-21 Thread Ted Unangst
On May 19, 2011, at 1:21 PM, Mike Belopuhov wrote: > On Thu, May 19, 2011 at 7:12 PM, Thordur Bjornsson wrote: >> On Thu, May 19, 2011 at 07:52:44PM +0300, Michael Pounov wrote: >>> Add AVL tree implementation and merge few RB tree related macros. >>> >>>

Re: AVL tree

2011-05-20 Thread Ariane van der Steldt
On Fri, May 20, 2011 at 11:23:47AM +0200, Mike Belopuhov wrote: > On Fri, May 20, 2011 at 4:04 AM, Ariane van der Steldt > wrote: > > AVL trees have a difference of max 1 between the longest and shortest > > path to a leaf, whereas RB-trees have at max the longest path be double > > the length of

Re: AVL tree

2011-05-20 Thread Michael Pounov
On Fri, 20 May 2011 05:01:41 +0200 Ariane van der Steldt wrote: > On Thu, May 19, 2011 at 08:28:09PM +0300, Michael Pounov wrote: > > Add AVL tree implementation and merge few RB tree related macros. > > > > If you have comments or any claims, please send me feedback &g

Re: AVL tree

2011-05-20 Thread Mike Belopuhov
On Fri, May 20, 2011 at 4:04 AM, Ariane van der Steldt wrote: > > AVL trees have a difference of max 1 between the longest and shortest > path to a leaf, whereas RB-trees have at max the longest path be double > the length of the shortest path. > I.e. work case lookups require traversal of >ln

Re: AVL tree

2011-05-20 Thread Michael Pounov
I test this implementation with 1000 entry inserted by random() ;) average seek time with random search of 1 is from 2 to 3 seconds On Fri, 20 May 2011 04:04:07 +0200 Ariane van der Steldt wrote: > On Thu, May 19, 2011 at 07:33:22PM +0200, Mike Belopuhov wrote: > > On Thu, May 19, 2011 a

Re: AVL tree

2011-05-19 Thread Ariane van der Steldt
On Thu, May 19, 2011 at 08:28:09PM +0300, Michael Pounov wrote: > Add AVL tree implementation and merge few RB tree related macros. > > If you have comments or any claims, please send me feedback > and I will fix them. > > >>>>>>>>>>>>>&

Re: AVL tree

2011-05-19 Thread Ariane van der Steldt
On Thu, May 19, 2011 at 07:33:22PM +0200, Mike Belopuhov wrote: > On Thu, May 19, 2011 at 7:25 PM, Michael Pounov wrote: > > Not see differences in results with performance from RB tree vs AVL, Which tree size did you use to test that? Which insert order (yes, this is relevant: with the right ord

Re: AVL tree

2011-05-19 Thread Owain Ainsworth
On Thu, May 19, 2011 at 05:27:01PM +, Thordur Bjornsson wrote: > On Thu, May 19, 2011 at 07:21:21PM +0200, Mike Belopuhov wrote: > > On Thu, May 19, 2011 at 7:12 PM, Thordur Bjornsson wrote: > > > On Thu, May 19, 2011 at 07:52:44PM +0300, Michael Pounov wrote: &

Re: AVL tree

2011-05-19 Thread Michael Pounov
AVL implementation consume less memory from RB tree implementation On Thu, 19 May 2011 19:33:22 +0200 Mike Belopuhov wrote: > On Thu, May 19, 2011 at 7:25 PM, Michael Pounov wrote: > > Not see differences in results with performance from RB tree vs AVL, > > but right solution for problems when

Re: AVL tree

2011-05-19 Thread Mike Belopuhov
On Thu, May 19, 2011 at 7:25 PM, Michael Pounov wrote: > Not see differences in results with performance from RB tree vs AVL, > but right solution for problems when we have choice between algorithms. > if you don't see any difference then what's the point in having them both available? how are

Re: AVL tree

2011-05-19 Thread Michael Pounov
Add AVL tree implementation and merge few RB tree related macros. If you have comments or any claims, please send me feedback and I will fix them. >>>>>>>>>>>>>>>> Inline patch:: --- /usr/src/sys/sys/tree.h Mon Mar 2 11:42:55 2009 +++ tree.h

Re: AVL tree

2011-05-19 Thread Thordur Bjornsson
On Thu, May 19, 2011 at 07:21:21PM +0200, Mike Belopuhov wrote: > On Thu, May 19, 2011 at 7:12 PM, Thordur Bjornsson wrote: > > On Thu, May 19, 2011 at 07:52:44PM +0300, Michael Pounov wrote: > >> Add AVL tree implementation and merge few RB tree related macros. > >> &

Re: AVL tree

2011-05-19 Thread Michael Pounov
at 07:52:44PM +0300, Michael Pounov wrote: > >> Add AVL tree implementation and merge few RB tree related macros. > >> > >> If you have comments or any claims, please send me feedback > >> and I will fix them. > > cool. but tech@ removes attachment

Re: AVL tree

2011-05-19 Thread Owain Ainsworth
On Thu, May 19, 2011 at 08:16:22PM +0300, Michael Pounov wrote: > Add AVL tree implementation and merge few RB tree related macros. > > If you have comments or any claims, please send me feedback > and I will fix them. > > Include patch file >

Re: AVL tree

2011-05-19 Thread Mike Belopuhov
On Thu, May 19, 2011 at 7:12 PM, Thordur Bjornsson wrote: > On Thu, May 19, 2011 at 07:52:44PM +0300, Michael Pounov wrote: >> Add AVL tree implementation and merge few RB tree related macros. >> >> If you have comments or any claims, please send me feedback >> and I

Re: AVL tree

2011-05-19 Thread Michael Pounov
Add AVL tree implementation and merge few RB tree related macros. If you have comments or any claims, please send me feedback and I will fix them. Include patch file -- M.Punov - AITNET - Sofia/Bulgaria - Software & Network Solutions (+359) 888 73 73 58;(+359) 2 402

Re: AVL tree

2011-05-19 Thread Owain Ainsworth
On Thu, May 19, 2011 at 07:52:44PM +0300, Michael Pounov wrote: > Add AVL tree implementation and merge few RB tree related macros. > > If you have comments or any claims, please send me feedback > and I will fix them. First of all, before we get anto any technical discussion

Re: AVL tree

2011-05-19 Thread Thordur Bjornsson
On Thu, May 19, 2011 at 07:52:44PM +0300, Michael Pounov wrote: > Add AVL tree implementation and merge few RB tree related macros. > > If you have comments or any claims, please send me feedback > and I will fix them. cool. but tech@ removes attachments, send your diffs inline.

AVL tree

2011-05-19 Thread Michael Pounov
Add AVL tree implementation and merge few RB tree related macros. If you have comments or any claims, please send me feedback and I will fix them. -- M.Punov - AITNET - Sofia/Bulgaria - Software & Network Solutions (+359) 888 73 73 58;(+359) 2 402 4000 [demime 1