X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fsorter%2Fsort-test.c;h=5464f744fd1eb226d2af7df4a82d8b43805021fb;hb=332c927b8301d01c2c2d8f047a091a4396a6bc82;hp=ddf6734dc238c3acf400413abcba1394482393f6;hpb=239f3fb07d3b69db82ddb097f16c495c6a289349;p=libucw.git diff --git a/lib/sorter/sort-test.c b/lib/sorter/sort-test.c index ddf6734d..5464f744 100644 --- a/lib/sorter/sort-test.c +++ b/lib/sorter/sort-test.c @@ -18,18 +18,21 @@ #include #include #include +#include /*** Time measurement ***/ static void start(void) { + sync(); init_timer(); } static void stop(void) { + sync(); log(L_INFO, "Test took %.3fs", get_timer() / 1000.); } @@ -53,7 +56,7 @@ test_int(int mode, u64 size) { uns N = size ? nextprime(MIN(size/4, 0xffff0000)) : 0; uns K = N/4*3; - log(L_INFO, ">>> Integers (%s, N=%d)", ((char *[]) { "increasing", "decreasing", "random" })[mode], N); + log(L_INFO, ">>> Integers (%s, N=%u)", ((char *[]) { "increasing", "decreasing", "random" })[mode], N); struct fastbuf *f = bopen_tmp(65536); for (uns i=0; i>> Counted integers (%s, N=%d, mult=%d)", ((char *[]) { "increasing", "decreasing", "random" })[mode], N, mult); + log(L_INFO, ">>> Counted integers (%s, N=%u, mult=%u)", ((char *[]) { "increasing", "decreasing", "random" })[mode], N, mult); struct fastbuf *f = bopen_tmp(65536); for (uns m=0; m>> Hashes (%s, N=%d)", ((char *[]) { "increasing", "decreasing", "random" })[mode], N); + log(L_INFO, ">>> Hashes (%s, N=%u)", ((char *[]) { "increasing", "decreasing", "random" })[mode], N); struct key3 k, lastk; struct fastbuf *f = bopen_tmp(65536); @@ -323,7 +326,7 @@ test_strings(uns mode, u64 size) { uns avg_item_size = KEY4_MAX/2 + 4 + (mode ? 128 : 0); uns N = MIN(size / avg_item_size, 0xffffffff); - log(L_INFO, ">>> Strings %s(N=%d)", (mode ? "with data " : ""), N); + log(L_INFO, ">>> Strings %s(N=%u)", (mode ? "with data " : ""), N); srand(1); struct key4 k, lastk; @@ -513,10 +516,11 @@ test_graph(uns mode, u64 size) uns N = 3; while ((u64)N*(N+2)*4 < size) N = nextprime(N); - log(L_INFO, ">>> Graph%s (N=%d)", (mode ? "" : " with custom presorting"), N); + log(L_INFO, ">>> Graph%s (N=%u)", (mode ? "" : " with custom presorting"), N); s5_N = N; s5_K = N/4*3; s5_L = N/3*2; + s5_i = s5_j = 0; struct fastbuf *in = NULL; if (mode)