Re: [ovs-dev] [PATCH] cmap: Fix cmap_next_position()

2014-07-16 Thread Daniele Di Proietto
I’m running from the test suite, with GCC 4.9 It was slow because on my dev machine I compile without optimization (my bad). With optimizations: - without testing cmap_next_position() : 8.6s - if we always test also cmap_next_position() always (like you suggested): 18.8s So I’m posting v2 with

Re: [ovs-dev] [PATCH] cmap: Fix cmap_next_position()

2014-07-16 Thread Ben Pfaff
There's a couple of reasons that test-cmap can be slow. First, if you run it without a numerical argument, it iterates 100 times. That takes a long time, and it's only meant for cases where you're doing actual development and want high confidence. The testsuite gives it an argument of 1, so that

Re: [ovs-dev] [PATCH] cmap: Fix cmap_next_position()

2014-07-16 Thread Daniele Di Proietto
Thanks, The reason I didn’t do that in the first place is that test-cmap is already taking 55s to run on my machine, and I thought that adding other code to check_cmap() might increase runtime significantly (we call check_cmap() a lot and cmap_next_position() is slow). After applying your sugge

Re: [ovs-dev] [PATCH] cmap: Fix cmap_next_position()

2014-07-16 Thread Ben Pfaff
On Tue, Jul 15, 2014 at 09:57:55PM -0700, Daniele Di Proietto wrote: > cmap_next_position() didn't update the node pointer while iterating through a > list of nodes with the same hash. > This commit fixes the bug and improve test-cmap to detect it. > > Signed-off-by: Daniele Di Proietto Good cat

[ovs-dev] [PATCH] cmap: Fix cmap_next_position()

2014-07-15 Thread Daniele Di Proietto
cmap_next_position() didn't update the node pointer while iterating through a list of nodes with the same hash. This commit fixes the bug and improve test-cmap to detect it. Signed-off-by: Daniele Di Proietto --- lib/cmap.c| 2 +- tests/test-cmap.c | 31 +++