X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fsorter%2Fsort-test.c;h=5fcbbaf74e65c71de9a9d48cdd75e5c0de04fffe;hb=c0544008a494710146ac6cf88b61b5fd2d46f51b;hp=f103710070e9115e4b1544323b5b24ec2e725969;hpb=87b27e3e532a51e97407cd6f54533138d78ebd01;p=libucw.git diff --git a/lib/sorter/sort-test.c b/lib/sorter/sort-test.c index f1037100..5fcbbaf7 100644 --- a/lib/sorter/sort-test.c +++ b/lib/sorter/sort-test.c @@ -24,6 +24,7 @@ /*** Time measurement ***/ static timestamp_t timer; +static uns test_id; static void start(void) @@ -36,7 +37,7 @@ static void stop(void) { sync(); - log(L_INFO, "Test took %.3fs", get_timer(&timer) / 1000.); + msg(L_INFO, "Test %d took %.3fs", test_id, get_timer(&timer) / 1000.); } /*** Simple 4-byte integer keys ***/ @@ -60,7 +61,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=%u)", ((char *[]) { "increasing", "decreasing", "random" })[mode], N); + msg(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=%u, mult=%u)", ((char *[]) { "increasing", "decreasing", "random" })[mode], N, mult); + msg(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=%u)", ((char *[]) { "increasing", "decreasing", "random" })[mode], N); + msg(L_INFO, ">>> Hashes (%s, N=%u)", ((char *[]) { "increasing", "decreasing", "random" })[mode], N); struct key3 k, lastk; struct fastbuf *f = bopen_tmp(65536); @@ -323,7 +324,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=%u)", (mode ? "with data " : ""), N); + msg(L_INFO, ">>> Strings %s(N=%u)", (mode ? "with data " : ""), N); srand(1); struct key4 k, lastk; @@ -514,7 +515,7 @@ 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=%u)", (mode ? "" : " with custom presorting"), N); + msg(L_INFO, ">>> Graph%s (N=%u)", (mode ? "" : " with custom presorting"), N); s5_N = N; s5_K = N/4*3; s5_L = N/3*2; @@ -580,7 +581,7 @@ test_int64(int mode, u64 size) { u64 N = size ? nextprime(MIN(size/8, 0xffff0000)) : 0; u64 K = N/4*3; - log(L_INFO, ">>> 64-bit integers (%s, N=%llu)", ((char *[]) { "increasing", "decreasing", "random" })[mode], (long long)N); + msg(L_INFO, ">>> 64-bit integers (%s, N=%llu)", ((char *[]) { "increasing", "decreasing", "random" })[mode], (long long)N); struct fastbuf *f = bopen_tmp(65536); for (u64 i=0; i