tests/test-cmap: Balance benchmarks between cmap and hmap.
authorJarno Rajahalme <jrajahalme@nicira.com>
Wed, 24 Sep 2014 17:39:20 +0000 (10:39 -0700)
committerJarno Rajahalme <jrajahalme@nicira.com>
Mon, 6 Oct 2014 22:33:42 +0000 (15:33 -0700)
commit44a48152d82b820f0e9d090c31d89ab8d7f9c6bf
treed457b183de11cb314498e932df959b1d589a72bb
parentee58b46960f3a922d5b4d426afc62cfa177819b4
tests/test-cmap: Balance benchmarks between cmap and hmap.

The test cases have been carefully crafted so that we do the same
amount of "overhead" operations in each case.  Earlier, with no
mutations, the number of random number generations was different for
hmap and cmap test cases.  hmap test was also missing an ignore() call.
Now the numbers look like this:

$ tests/ovstest test-cmap benchmark 2000000 8 0
Benchmarking with n=2000000, 8 threads, 0.00% mutations:
cmap insert:    597 ms
cmap iterate:    65 ms
cmap search:    299 ms
cmap destroy:   251 ms

hmap insert:    243 ms
hmap iterate:   201 ms
hmap search:    299 ms
hmap destroy:   202 ms

So it seems search on cmap can be as fast as on hmap in the
single-threaded case.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
tests/test-cmap.c