From: Heng Li Date: Sun, 8 Apr 2012 23:39:42 +0000 (-0400) Subject: changed the order X-Git-Tag: spawn-final~56 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=b1faf38af5fab9ca0fb0b20d65c58a900de02420;p=klib.git changed the order --- diff --git a/test/kbit_test.c b/test/kbit_test.c index 5d9bc6c..393892a 100644 --- a/test/kbit_test.c +++ b/test/kbit_test.c @@ -103,20 +103,6 @@ int main(void) for (i = 0; i < N; ++i) x[i] = (uint64_t)lrand48() << 32 | lrand48(); - fprintf(stderr, "===> Count '%c' in 2-bit encoded integers <===\n", "ACGT"[c]); - - t = clock(); - for (j = 0, cnt = 0; j < M; ++j) - for (i = 0; i < N; ++i) - cnt += kbi_DNAcount64(x[i], c); - fprintf(stderr, "%20s\t%20ld\t%10.3f\n", "kbit", (long)cnt, (double)(clock() - t) / CLOCKS_PER_SEC); - - t = clock(); - for (j = 0, cnt = 0; j < M; ++j) - for (i = 0; i < N; ++i) - cnt += bt1_countInU64(x[i], c); - fprintf(stderr, "%20s\t%20ld\t%10.3f\n", "bowtie1", (long)cnt, (double)(clock() - t) / CLOCKS_PER_SEC); - fprintf(stderr, "\n===> Calculate # of 1 in an integer (popcount) <===\n"); t = clock(); @@ -129,7 +115,7 @@ int main(void) for (j = 0, cnt = 0; j < M; ++j) for (i = 0; i < N; ++i) cnt += bt1_pop64(x[i]); - fprintf(stderr, "%20s\t%20ld\t%10.3f\n", "bowtie1", (long)cnt, (double)(clock() - t) / CLOCKS_PER_SEC); + fprintf(stderr, "%20s\t%20ld\t%10.3f\n", "wiki-popcount_2", (long)cnt, (double)(clock() - t) / CLOCKS_PER_SEC); t = clock(); for (j = 0, cnt = 0; j < M; ++j) @@ -142,6 +128,21 @@ int main(void) cnt += sse2_bit_count((__m128i*)x, (__m128i*)(x+N)); fprintf(stderr, "%20s\t%20ld\t%10.3f\n", "SSE2-32bit", (long)cnt, (double)(clock() - t) / CLOCKS_PER_SEC); + fprintf(stderr, "\n===> Count '%c' in 2-bit encoded integers <===\n", "ACGT"[c]); + + t = clock(); + for (j = 0, cnt = 0; j < M; ++j) + for (i = 0; i < N; ++i) + cnt += kbi_DNAcount64(x[i], c); + fprintf(stderr, "%20s\t%20ld\t%10.3f\n", "kbit", (long)cnt, (double)(clock() - t) / CLOCKS_PER_SEC); + + t = clock(); + for (j = 0, cnt = 0; j < M; ++j) + for (i = 0; i < N; ++i) + cnt += bt1_countInU64(x[i], c); + fprintf(stderr, "%20s\t%20ld\t%10.3f\n", "bowtie1", (long)cnt, (double)(clock() - t) / CLOCKS_PER_SEC); + + fprintf(stderr, "\n"); free(x); return 0; }