diff options
| author | Siddhesh Poyarekar <siddhesh@redhat.com> | 2013-06-04 18:11:43 +0530 |
|---|---|---|
| committer | Siddhesh Poyarekar <siddhesh@redhat.com> | 2013-06-11 15:08:13 +0530 |
| commit | fec799f823100646f535c5e24128c648cba4c2c5 (patch) | |
| tree | 879cc54a136654f9fc77d4a43ad9666730e1e63b /string | |
| parent | 9702047480d9002522936c5e1e1ebe16f696880d (diff) | |
| download | glibc-fec799f823100646f535c5e24128c648cba4c2c5.tar.xz glibc-fec799f823100646f535c5e24128c648cba4c2c5.zip | |
Remove performance-related bits from string tests
Diffstat (limited to 'string')
| -rw-r--r-- | string/test-memccpy.c | 24 | ||||
| -rw-r--r-- | string/test-memchr.c | 24 | ||||
| -rw-r--r-- | string/test-memcmp.c | 24 | ||||
| -rw-r--r-- | string/test-memcpy.c | 24 | ||||
| -rw-r--r-- | string/test-memmem.c | 30 | ||||
| -rw-r--r-- | string/test-memmove.c | 28 | ||||
| -rw-r--r-- | string/test-memset.c | 29 | ||||
| -rw-r--r-- | string/test-rawmemchr.c | 24 | ||||
| -rw-r--r-- | string/test-strcasecmp.c | 24 | ||||
| -rw-r--r-- | string/test-strcasestr.c | 25 | ||||
| -rw-r--r-- | string/test-strcat.c | 25 | ||||
| -rw-r--r-- | string/test-strchr.c | 25 | ||||
| -rw-r--r-- | string/test-strcmp.c | 24 | ||||
| -rw-r--r-- | string/test-strcpy.c | 24 | ||||
| -rw-r--r-- | string/test-string.h | 14 | ||||
| -rw-r--r-- | string/test-strlen.c | 24 | ||||
| -rw-r--r-- | string/test-strncasecmp.c | 24 | ||||
| -rw-r--r-- | string/test-strncat.c | 25 | ||||
| -rw-r--r-- | string/test-strncmp.c | 35 | ||||
| -rw-r--r-- | string/test-strncpy.c | 24 | ||||
| -rw-r--r-- | string/test-strnlen.c | 24 | ||||
| -rw-r--r-- | string/test-strpbrk.c | 24 | ||||
| -rw-r--r-- | string/test-strrchr.c | 24 | ||||
| -rw-r--r-- | string/test-strspn.c | 24 | ||||
| -rw-r--r-- | string/test-strstr.c | 24 |
25 files changed, 0 insertions, 620 deletions
diff --git a/string/test-memccpy.c b/string/test-memccpy.c index 577a82efe0..a3f20a8c48 100644 --- a/string/test-memccpy.c +++ b/string/test-memccpy.c @@ -74,24 +74,6 @@ do_one_test (impl_t *impl, void *dst, const void *src, int c, size_t len, ret = 1; return; } - - if (HP_TIMING_AVAIL) - { - hp_timing_t start __attribute__ ((unused)); - hp_timing_t stop __attribute__ ((unused)); - hp_timing_t best_time = ~ (hp_timing_t) 0; - size_t i; - - for (i = 0; i < 32; ++i) - { - HP_TIMING_NOW (start); - CALL (impl, dst, src, c, n); - HP_TIMING_NOW (stop); - HP_TIMING_BEST (best_time, start, stop); - } - - printf ("\t%zd", (size_t) best_time); - } } static void @@ -122,14 +104,8 @@ do_test (size_t align1, size_t align2, int c, size_t len, size_t n, for (i = len; i + align1 < page_size && i < len + 64; ++i) s1[i] = 32 + 32 * i % (max_char - 32); - if (HP_TIMING_AVAIL) - printf ("Length %4zd, n %4zd, char %d, alignment %2zd/%2zd:", len, n, c, align1, align2); - FOR_EACH_IMPL (impl, 0) do_one_test (impl, s2, s1, c, len, n); - - if (HP_TIMING_AVAIL) - putchar ('\n'); } static void diff --git a/string/test-memchr.c b/string/test-memchr.c index dffc858624..bc1767c692 100644 --- a/string/test-memchr.c +++ b/string/test-memchr.c @@ -47,24 +47,6 @@ do_one_test (impl_t *impl, const char *s, int c, size_t n, char *exp_res) ret = 1; return; } - - if (HP_TIMING_AVAIL) - { - hp_timing_t start __attribute ((unused)); - hp_timing_t stop __attribute ((unused)); - hp_timing_t best_time = ~ (hp_timing_t) 0; - size_t i; - - for (i = 0; i < 32; ++i) - { - HP_TIMING_NOW (start); - CALL (impl, s, c, n); - HP_TIMING_NOW (stop); - HP_TIMING_BEST (best_time, start, stop); - } - - printf ("\t%zd", (size_t) best_time); - } } static void @@ -97,14 +79,8 @@ do_test (size_t align, size_t pos, size_t len, int seek_char) buf1[align + len] = seek_char; } - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd:", pos, align); - FOR_EACH_IMPL (impl, 0) do_one_test (impl, (char *) (buf1 + align), seek_char, len, result); - - if (HP_TIMING_AVAIL) - putchar ('\n'); } static void diff --git a/string/test-memcmp.c b/string/test-memcmp.c index 654dfa22f3..b30e34d0e4 100644 --- a/string/test-memcmp.c +++ b/string/test-memcmp.c @@ -100,24 +100,6 @@ do_one_test (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t len, { if (check_result (impl, s1, s2, len, exp_result) < 0) return; - - if (HP_TIMING_AVAIL) - { - hp_timing_t start __attribute ((unused)); - hp_timing_t stop __attribute ((unused)); - hp_timing_t best_time = ~ (hp_timing_t) 0; - size_t i; - - for (i = 0; i < 32; ++i) - { - HP_TIMING_NOW (start); - CALL (impl, s1, s2, len); - HP_TIMING_NOW (stop); - HP_TIMING_BEST (best_time, start, stop); - } - - printf ("\t%zd", (size_t) best_time); - } } static void @@ -147,14 +129,8 @@ do_test (size_t align1, size_t align2, size_t len, int exp_result) s2[len] = align2; s2[len - 1] -= exp_result; - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd/%2zd:", len, align1, align2); - FOR_EACH_IMPL (impl, 0) do_one_test (impl, s1, s2, len, exp_result); - - if (HP_TIMING_AVAIL) - putchar ('\n'); } static void diff --git a/string/test-memcpy.c b/string/test-memcpy.c index eb9c308059..d121ef02a5 100644 --- a/string/test-memcpy.c +++ b/string/test-memcpy.c @@ -68,24 +68,6 @@ do_one_test (impl_t *impl, char *dst, const char *src, ret = 1; return; } - - if (HP_TIMING_AVAIL) - { - hp_timing_t start __attribute ((unused)); - hp_timing_t stop __attribute ((unused)); - hp_timing_t best_time = ~ (hp_timing_t) 0; - size_t i; - - for (i = 0; i < 32; ++i) - { - HP_TIMING_NOW (start); - CALL (impl, dst, src, len); - HP_TIMING_NOW (stop); - HP_TIMING_BEST (best_time, start, stop); - } - - printf ("\t%zd", (size_t) best_time); - } } static void @@ -108,14 +90,8 @@ do_test (size_t align1, size_t align2, size_t len) for (i = 0, j = 1; i < len; i++, j += 23) s1[i] = j; - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd/%2zd:", len, align1, align2); - FOR_EACH_IMPL (impl, 0) do_one_test (impl, s2, s1, len); - - if (HP_TIMING_AVAIL) - putchar ('\n'); } static void diff --git a/string/test-memmem.c b/string/test-memmem.c index fec8b55990..d98ede79e3 100644 --- a/string/test-memmem.c +++ b/string/test-memmem.c @@ -82,24 +82,6 @@ do_one_test (impl_t *impl, const void *haystack, size_t haystack_len, if (check_result (impl, haystack, haystack_len, needle, needle_len, expected) < 0) return; - - if (HP_TIMING_AVAIL) - { - hp_timing_t start __attribute ((unused)); - hp_timing_t stop __attribute ((unused)); - hp_timing_t best_time = ~ (hp_timing_t) 0; - size_t i; - - for (i = 0; i < 32; ++i) - { - HP_TIMING_NOW (start); - CALL (impl, haystack, haystack_len, needle, needle_len); - HP_TIMING_NOW (stop); - HP_TIMING_BEST (best_time, start, stop); - } - - printf ("\t%zd", (size_t) best_time); - } } static void @@ -110,16 +92,10 @@ do_test (const char *str, size_t len, size_t idx) memcpy (tmpbuf, buf1 + idx, len); memcpy (buf1 + idx, str, len); - if (HP_TIMING_AVAIL) - printf ("String %s, offset %zd:", str, idx); - FOR_EACH_IMPL (impl, 0) do_one_test (impl, buf1, BUF1PAGES * page_size, str, len, buf1 + idx); memcpy (buf1 + idx, tmpbuf, len); - - if (HP_TIMING_AVAIL) - putchar ('\n'); } static void @@ -143,16 +119,10 @@ do_random_tests (void) buf1[idx + off] = ch; } - if (HP_TIMING_AVAIL) - printf ("String %.*s, offset %zd:", (int) len, buf1 + idx, idx); - FOR_EACH_IMPL (impl, 0) do_one_test (impl, buf1, BUF1PAGES * page_size, buf1 + idx, len, buf1 + idx); - if (HP_TIMING_AVAIL) - putchar ('\n'); - memcpy (buf1 + idx, tmpbuf, len); } } diff --git a/string/test-memmove.c b/string/test-memmove.c index e47446cece..4ec55b2fcc 100644 --- a/string/test-memmove.c +++ b/string/test-memmove.c @@ -90,28 +90,6 @@ do_one_test (impl_t *impl, char *dst, char *src, const char *orig_src, ret = 1; return; } - - if (HP_TIMING_AVAIL) - { - hp_timing_t start __attribute ((unused)); - hp_timing_t stop __attribute ((unused)); - hp_timing_t best_time = ~ (hp_timing_t) 0; - size_t i; - - for (i = 0; i < 32; ++i) - { - HP_TIMING_NOW (start); -#ifdef TEST_BCOPY - CALL (impl, src, dst, len); -#else - CALL (impl, dst, src, len); -#endif - HP_TIMING_NOW (stop); - HP_TIMING_BEST (best_time, start, stop); - } - - printf ("\t%zd", (size_t) best_time); - } } static void @@ -134,14 +112,8 @@ do_test (size_t align1, size_t align2, size_t len) for (i = 0, j = 1; i < len; i++, j += 23) s1[i] = j; - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd/%2zd:", len, align1, align2); - FOR_EACH_IMPL (impl, 0) do_one_test (impl, s2, (char *) (buf2 + align1), s1, len); - - if (HP_TIMING_AVAIL) - putchar ('\n'); } static void diff --git a/string/test-memset.c b/string/test-memset.c index 969772dec7..9981fcef46 100644 --- a/string/test-memset.c +++ b/string/test-memset.c @@ -91,29 +91,6 @@ do_one_test (impl_t *impl, char *s, int c __attribute ((unused)), size_t n) ret = 1; return; } - - if (HP_TIMING_AVAIL) - { - hp_timing_t start __attribute ((unused)); - hp_timing_t stop __attribute ((unused)); - hp_timing_t best_time = ~ (hp_timing_t) 0; - size_t i; - - for (i = 0; i < 32; ++i) - { - HP_TIMING_NOW (start); -#ifdef TEST_BZERO - CALL (impl, s, n); -#else - CALL (impl, s, c, n); -#endif - - HP_TIMING_NOW (stop); - HP_TIMING_BEST (best_time, start, stop); - } - - printf ("\t%zd", (size_t) best_time); - } } static void @@ -123,14 +100,8 @@ do_test (size_t align, int c, size_t len) if (align + len > page_size) return; - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd, c %2d:", len, align, c); - FOR_EACH_IMPL (impl, 0) do_one_test (impl, (char *) buf1 + align, c, len); - - if (HP_TIMING_AVAIL) - putchar ('\n'); } #ifndef TEST_BZERO diff --git a/string/test-rawmemchr.c b/string/test-rawmemchr.c index ebfd678328..9e4952f7c7 100644 --- a/string/test-rawmemchr.c +++ b/string/test-rawmemchr.c @@ -49,24 +49,6 @@ do_one_test (impl_t *impl, const char *s, int c, char *exp_res) ret = 1; return; } - - if (HP_TIMING_AVAIL) - { - hp_timing_t start __attribute ((unused)); - hp_timing_t stop __attribute ((unused)); - hp_timing_t best_time = ~ (hp_timing_t) 0; - size_t i; - - for (i = 0; i < 32; ++i) - { - HP_TIMING_NOW (start); - CALL (impl, s, c); - HP_TIMING_NOW (stop); - HP_TIMING_BEST (best_time, start, stop); - } - - printf ("\t%zd", (size_t) best_time); - } } static void @@ -93,14 +75,8 @@ do_test (size_t align, size_t pos, size_t len, int seek_char) buf1[align + len] = -seek_char; result = (char *) (buf1 + align + pos); - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd:", pos, align); - FOR_EACH_IMPL (impl, 0) do_one_test (impl, (char *) (buf1 + align), seek_char, result); - - if (HP_TIMING_AVAIL) - putchar ('\n'); } static void diff --git a/string/test-strcasecmp.c b/string/test-strcasecmp.c index ed49733fd6..f32150198f 100644 --- a/string/test-strcasecmp.c +++ b/string/test-strcasecmp.c @@ -73,24 +73,6 @@ do_one_test (impl_t *impl, const char *s1, const char *s2, int exp_result) ret = 1; return; } - - if (HP_TIMING_AVAIL) - { - hp_timing_t start __attribute ((unused)); - hp_timing_t stop __attribute ((unused)); - hp_timing_t best_time = ~ (hp_timing_t) 0; - size_t i; - - for (i = 0; i < 32; ++i) - { - HP_TIMING_NOW (start); - CALL (impl, s1, s2); - HP_TIMING_NOW (stop); - HP_TIMING_BEST (best_time, start, stop); - } - - printf ("\t%zd", (size_t) best_time); - } } static void @@ -129,14 +111,8 @@ do_test (size_t align1, size_t align2, size_t len, int max_char, else s2[len - 1] -= exp_result; - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment %2zd/%2zd:", len, align1, align2); - FOR_EACH_IMPL (impl, 0) do_one_test (impl, s1, s2, exp_result); - - if (HP_TIMING_AVAIL) - putchar ('\n'); } static void diff --git a/string/test-strcasestr.c b/string/test-strcasestr.c index 85e65fad5c..5b1d827a05 100644 --- a/string/test-strcasestr.c +++ b/string/test-strcasestr.c @@ -78,24 +78,6 @@ do_one_test (impl_t *impl, const char *s1, const char *s2, char *exp_result) { if (check_result (impl, s1, s2, exp_result) < 0) return; - - if (HP_TIMING_AVAIL) - { - hp_timing_t start __attribute ((unused)); - hp_timing_t stop __attribute ((unused)); - hp_timing_t best_time = ~(hp_timing_t) 0; - size_t i; - - for (i = 0; i < 32; ++i) - { - HP_TIMING_NOW (start); - CALL (impl, s1, s2); - HP_TIMING_NOW (stop); - HP_TIMING_BEST (best_time, start, stop); - } - - printf ("\t%zd", (size_t) best_time); - } } @@ -135,15 +117,8 @@ do_test (size_t align1, size_t align2, size_t len1, size_t len2, } s1[len1] = '\0'; - if (HP_TIMING_AVAIL) - printf ("Length %4zd/%zd, alignment %2zd/%2zd, %s:", - len1, len2, align1, align2, fail ? "fail" : "found"); - FOR_EACH_IMPL (impl, 0) do_one_test (impl, s1, s2, fail ? NULL : s1 + len1 - len2); - - if (HP_TIMING_AVAIL) - putchar ('\n'); } static void diff --git a/string/test-strcat.c b/string/test-strcat.c index 7a47a4b96c..89fc90d1d0 100644 --- a/string/test-strcat.c +++ b/string/test-strcat.c @@ -56,25 +56,6 @@ do_one_test (impl_t *impl, char *dst, const char *src) ret = 1; return; } - - if (HP_TIMING_AVAIL) - { - hp_timing_t start __attribute ((unused)); - hp_timing_t stop __attribute ((unused)); - hp_timing_t best_time = ~ (hp_timing_t) 0; - size_t i; - - for (i = 0; i < 32; ++i) - { - dst[k] = '\0'; - HP_TIMING_NOW (start); - CALL (impl, dst, src); - HP_TIMING_NOW (stop); - HP_TIMING_BEST (best_time, start, stop); - } - - printf ("\t%zd", (size_t) best_time); - } } static void @@ -101,17 +82,11 @@ do_test (size_t align1, size_t align2, size_t len1, size_t len2, int max_char) for (i = 0; i < len2; i++) s2[i] = 32 + 23 * i % (max_char - 32); - if (HP_TIMING_AVAIL) - printf ("Length %4zd/%4zd, alignment %2zd/%2zd:", len1, len2, align1, align2); - FOR_EACH_IMPL (impl, 0) { s2[len2] = '\0'; do_one_test (impl, s2, s1); } - - if (HP_TIMING_AVAIL) - putchar ('\n'); } static void diff --git a/string/test-strchr.c b/string/test-strchr.c index deca51692c..cbcf53ef80 100644 --- a/string/test-strchr.c +++ b/string/test-strchr.c @@ -107,24 +107,6 @@ do_one_test (impl_t *impl, const CHAR *s, int c, const CHAR *exp_res) { if (check_result (impl, s, c, exp_res) < 0) return; - - if (HP_TIMING_AVAIL) - { - hp_timing_t start __attribute ((unused)); - hp_timing_t stop __attribute ((unused)); - hp_timing_t best_time = ~ (hp_timing_t) 0; - size_t i; - - for (i = 0; i < 32; ++i) - { - HP_TIMING_NOW (start); - CALL (impl, s, c); - HP_TIMING_NOW (stop); - HP_TIMING_BEST (best_time, start, stop); - } - - printf ("\t%zd", (size_t) best_time); - } } static void @@ -160,15 +142,8 @@ do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char) else result = NULLRET (buf + align + len); - if (HP_TIMING_AVAIL) - printf ("Length %4zd, alignment in bytes %2zd:", - pos, align * sizeof (CHAR)); - FOR_EACH_IMPL (impl, 0) do_one_test (impl, buf + align, seek_char, result); - - if (HP_TIMING_AVAIL) - putchar ('\n'); } static void diff --git a/string/test-strcmp.c b/string/test-strcmp.c index d9b69fa830..f666993929 100644 --- a/string/test-strcmp.c +++ b/string/test-strcmp.c @@ -161,24 +161,6 @@ do_one_test (impl_t *impl, { if (check_result (impl, s1, s2, exp_result) < 0) return; - - if (HP_TIMING_AVAIL) - { - hp_timing_t start __attribute ((unused)); - hp_timing_t stop __attribute ((unused)); - hp_timing_t best_time = ~ (hp_timing_t) 0; - size_t i; - - for (i = 0; i < 32; ++i) - { - HP_TIMING_NOW (start); - CALL (impl, s1, s2); - HP_TIMING_NOW (stop); - HP_TIMING_BEST (best_time, start, stop); |
