Re: [PATCH 05/13] rbtree: performance and correctness test

2012-07-11 Thread Daniel Santos
On 07/11/2012 01:14 AM, Michel Lespinasse wrote: > On Tue, Jul 10, 2012 at 5:27 AM, Michal Nazarewicz wrote: >> On Tue, 10 Jul 2012 01:35:15 +0200, Michel Lespinasse >> wrote: >>> + u32 prev_key = 0; >>> + >>> + for (rb = rb_first(); rb; rb = rb_next(rb)) { >>> +

Re: [PATCH 05/13] rbtree: performance and correctness test

2012-07-11 Thread Michel Lespinasse
On Tue, Jul 10, 2012 at 5:27 AM, Michal Nazarewicz wrote: > On Tue, 10 Jul 2012 01:35:15 +0200, Michel Lespinasse > wrote: >> + u32 prev_key = 0; >> + >> + for (rb = rb_first(); rb; rb = rb_next(rb)) { >> + struct test_node *node = rb_entry(rb, struct test_node, >>

Re: [PATCH 05/13] rbtree: performance and correctness test

2012-07-11 Thread Michel Lespinasse
On Tue, Jul 10, 2012 at 5:27 AM, Michal Nazarewicz min...@mina86.com wrote: On Tue, 10 Jul 2012 01:35:15 +0200, Michel Lespinasse wal...@google.com wrote: + u32 prev_key = 0; + + for (rb = rb_first(root); rb; rb = rb_next(rb)) { + struct test_node *node =

Re: [PATCH 05/13] rbtree: performance and correctness test

2012-07-11 Thread Daniel Santos
On 07/11/2012 01:14 AM, Michel Lespinasse wrote: On Tue, Jul 10, 2012 at 5:27 AM, Michal Nazarewicz min...@mina86.com wrote: On Tue, 10 Jul 2012 01:35:15 +0200, Michel Lespinasse wal...@google.com wrote: + u32 prev_key = 0; + + for (rb = rb_first(root); rb; rb = rb_next(rb)) {

Re: [PATCH 05/13] rbtree: performance and correctness test

2012-07-10 Thread Michel Lespinasse
On Tue, Jul 10, 2012 at 5:27 AM, Michal Nazarewicz wrote: > On Tue, 10 Jul 2012 01:35:15 +0200, Michel Lespinasse > wrote: >> + for (i = 0; i < CHECK_LOOPS; i++) { >> + init(); > > Is this init() needed? So, the reasoning here is that we first have timed loops, where we

Re: [PATCH 05/13] rbtree: performance and correctness test

2012-07-10 Thread Michal Nazarewicz
On Tue, 10 Jul 2012 01:35:15 +0200, Michel Lespinasse wrote: This small module helps measure the performance of rbtree insert and erase. Additionally, we run a few correctness tests to check that the rbtrees have all desired properties: - contains the right number of nodes in the order

Re: [PATCH 05/13] rbtree: performance and correctness test

2012-07-10 Thread Michal Nazarewicz
On Tue, 10 Jul 2012 01:35:15 +0200, Michel Lespinasse wal...@google.com wrote: This small module helps measure the performance of rbtree insert and erase. Additionally, we run a few correctness tests to check that the rbtrees have all desired properties: - contains the right number of nodes in

Re: [PATCH 05/13] rbtree: performance and correctness test

2012-07-10 Thread Michel Lespinasse
On Tue, Jul 10, 2012 at 5:27 AM, Michal Nazarewicz min...@mina86.com wrote: On Tue, 10 Jul 2012 01:35:15 +0200, Michel Lespinasse wal...@google.com wrote: + for (i = 0; i CHECK_LOOPS; i++) { + init(); Is this init() needed? So, the reasoning here is that we first have

[PATCH 05/13] rbtree: performance and correctness test

2012-07-09 Thread Michel Lespinasse
This small module helps measure the performance of rbtree insert and erase. Additionally, we run a few correctness tests to check that the rbtrees have all desired properties: - contains the right number of nodes in the order desired, - never two consecutive red nodes on any path, - all paths to

[PATCH 05/13] rbtree: performance and correctness test

2012-07-09 Thread Michel Lespinasse
This small module helps measure the performance of rbtree insert and erase. Additionally, we run a few correctness tests to check that the rbtrees have all desired properties: - contains the right number of nodes in the order desired, - never two consecutive red nodes on any path, - all paths to