benchtests: Remove verification runs from benchmark tests

The test run is unnecessary and interferes with the benchmark.  The
tests are done during make check, so they're unnecessary here.

	* benchtests/bench-memccpy.c (do_one_test): Remove checks.
	* benchtests/bench-memchr.c (do_one_test): Likewise.
	* benchtests/bench-memcpy-large.c (do_one_test): Likewise.
	* benchtests/bench-memcpy.c (do_one_test): Likewise.
	* benchtests/bench-memmove-large.c (do_one_test): Likewise.
	* benchtests/bench-memmove.c (do_one_test): Likewise.
	* benchtests/bench-memset-large.c (do_one_test): Likewise.
	* benchtests/bench-memset.c (do_one_test): Likewise.
	* benchtests/bench-string.h (test_init): Remove memsets.
This commit is contained in:
Siddhesh Poyarekar 2017-08-11 12:17:24 +05:30
parent 925733a913
commit 61c982910d
10 changed files with 14 additions and 154 deletions

View file

@ -1,3 +1,15 @@
2017-08-11 Siddhesh Poyarekar <siddhesh@sourceware.org>
* benchtests/bench-memccpy.c (do_one_test): Remove checks.
* benchtests/bench-memchr.c (do_one_test): Likewise.
* benchtests/bench-memcpy-large.c (do_one_test): Likewise.
* benchtests/bench-memcpy.c (do_one_test): Likewise.
* benchtests/bench-memmove-large.c (do_one_test): Likewise.
* benchtests/bench-memmove.c (do_one_test): Likewise.
* benchtests/bench-memset-large.c (do_one_test): Likewise.
* benchtests/bench-memset.c (do_one_test): Likewise.
* benchtests/bench-string.h (test_init): Remove memsets.
2017-08-10 Rical Jasan <ricaljasan@pacific.net>
* manual/lang.texi

View file

@ -58,25 +58,9 @@ static void
do_one_test (impl_t *impl, void *dst, const void *src, int c, size_t len,
size_t n)
{
void *expect = len > n ? NULL : (char *) dst + len;
size_t i, iters = INNER_LOOP_ITERS;
timing_t start, stop, cur;
if (CALL (impl, dst, src, c, n) != expect)
{
error (0, 0, "Wrong result in function %s %p %p", impl->name,
CALL (impl, dst, src, c, n), expect);
ret = 1;
return;
}
if (memcmp (dst, src, len > n ? n : len) != 0)
{
error (0, 0, "Wrong result in function %s", impl->name);
ret = 1;
return;
}
TIMING_NOW (start);
for (i = 0; i < iters; ++i)
{

View file

@ -59,20 +59,11 @@ SIMPLE_MEMCHR (const CHAR *s, int c, size_t n)
#endif /* !USE_AS_MEMRCHR */
static void
do_one_test (impl_t *impl, const CHAR *s, int c, size_t n, CHAR *exp_res)
do_one_test (impl_t *impl, const CHAR *s, int c, size_t n)
{
CHAR *res = CALL (impl, s, c, n);
size_t i, iters = INNER_LOOP_ITERS;
timing_t start, stop, cur;
if (res != exp_res)
{
error (0, 0, "Wrong result in function %s %p %p", impl->name,
res, exp_res);
ret = 1;
return;
}
TIMING_NOW (start);
for (i = 0; i < iters; ++i)
{
@ -89,7 +80,6 @@ static void
do_test (size_t align, size_t pos, size_t len, int seek_char)
{
size_t i;
CHAR *result;
align &= 7;
if ((align + len) * sizeof (CHAR) >= page_size)
@ -109,11 +99,9 @@ do_test (size_t align, size_t pos, size_t len, int seek_char)
{
buf[align + pos] = seek_char;
buf[align + len] = -seek_char;
result = (CHAR *) (buf + align + pos);
}
else
{
result = NULL;
buf[align + len] = seek_char;
}
@ -121,7 +109,7 @@ do_test (size_t align, size_t pos, size_t len, int seek_char)
len, pos, align);
FOR_EACH_IMPL (impl, 0)
do_one_test (impl, (CHAR *) (buf + align), seek_char, len, result);
do_one_test (impl, (CHAR *) (buf + align), seek_char, len);
putchar ('\n');
}

View file

@ -39,26 +39,6 @@ do_one_test (json_ctx_t *json_ctx, impl_t *impl, char *dst, const char *src,
size_t i, iters = 16;
timing_t start, stop, cur;
/* Must clear the destination buffer updated by the previous run. */
for (i = 0; i < len; i++)
dst[i] = 0;
if (CALL (impl, dst, src, len) != MEMCPY_RESULT (dst, len))
{
error (0, 0, "Wrong result in function %s %p %p", impl->name,
CALL (impl, dst, src, len), MEMCPY_RESULT (dst, len));
ret = 1;
return;
}
if (memcmp (dst, src, len) != 0)
{
error (0, 0, "Wrong result in function %s dst \"%s\" src \"%s\"",
impl->name, dst, src);
ret = 1;
return;
}
TIMING_NOW (start);
for (i = 0; i < iters; ++i)
{

View file

@ -57,26 +57,6 @@ do_one_test (json_ctx_t *json_ctx, impl_t *impl, char *dst, const char *src,
size_t i, iters = INNER_LOOP_ITERS;
timing_t start, stop, cur;
/* Must clear the destination buffer set by the previous run. */
for (i = 0; i < len; i++)
dst[i] = 0;
if (CALL (impl, dst, src, len) != MEMCPY_RESULT (dst, len))
{
error (0, 0, "Wrong result in function %s %p %p", impl->name,
CALL (impl, dst, src, len), MEMCPY_RESULT (dst, len));
ret = 1;
return;
}
if (memcmp (dst, src, len) != 0)
{
error (0, 0, "Wrong result in function %s dst \"%s\" src \"%s\"",
impl->name, dst, src);
ret = 1;
return;
}
TIMING_NOW (start);
for (i = 0; i < iters; ++i)
{

View file

@ -35,27 +35,6 @@ do_one_test (impl_t *impl, char *dst, char *src, const char *orig_src,
size_t i, iters = 16;
timing_t start, stop, cur;
/* This also clears the destination buffer updated by the previous
run. */
memcpy (src, orig_src, len);
char *res = CALL (impl, dst, src, len);
if (res != dst)
{
error (0, 0, "Wrong result in function %s %p %p", impl->name,
res, dst);
ret = 1;
return;
}
if (memcmp (dst, orig_src, len) != 0)
{
error (0, 0, "Wrong result in function %s dst \"%s\" src \"%s\"",
impl->name, dst, src);
ret = 1;
return;
}
TIMING_NOW (start);
for (i = 0; i < iters; ++i)
{

View file

@ -70,31 +70,6 @@ do_one_test (impl_t *impl, char *dst, char *src, const char *orig_src,
size_t i, iters = INNER_LOOP_ITERS;
timing_t start, stop, cur;
/* This also clears the destination buffer set by the previous run. */
memcpy (src, orig_src, len);
#ifdef TEST_BCOPY
CALL (impl, src, dst, len);
#else
char *res;
res = CALL (impl, dst, src, len);
if (res != dst)
{
error (0, 0, "Wrong result in function %s %p %p", impl->name,
res, dst);
ret = 1;
return;
}
#endif
if (memcmp (dst, orig_src, len) != 0)
{
error (0, 0, "Wrong result in function %s dst \"%s\" src \"%s\"",
impl->name, dst, src);
ret = 1;
return;
}
TIMING_NOW (start);
for (i = 0; i < iters; ++i)
{

View file

@ -61,23 +61,6 @@ do_one_test (impl_t *impl, CHAR *s, int c __attribute ((unused)), size_t n)
{
size_t i, iters = 16;
timing_t start, stop, cur;
CHAR *tstbuf = malloc (n * sizeof (*s));
assert (tstbuf != NULL);
/* Must clear the destination buffer updated by the previous run. */
for (i = 0; i < n; i++)
s[i] = 0;
CHAR *res = CALL (impl, s, c, n);
if (res != s
|| SIMPLE_MEMSET (tstbuf, c, n) != tstbuf
|| MEMCMP (s, tstbuf, n) != 0)
{
error (0, 0, "Wrong result in function %s", impl->name);
ret = 1;
free (tstbuf);
return;
}
TIMING_NOW (start);
for (i = 0; i < iters; ++i)
@ -89,8 +72,6 @@ do_one_test (impl_t *impl, CHAR *s, int c __attribute ((unused)), size_t n)
TIMING_DIFF (cur, start, stop);
TIMING_PRINT_MEAN ((double) cur, (double) iters);
free (tstbuf);
}
static void

View file

@ -98,22 +98,6 @@ do_one_test (impl_t *impl, CHAR *s, int c __attribute ((unused)), size_t n)
{
size_t i, iters = INNER_LOOP_ITERS;
timing_t start, stop, cur;
CHAR tstbuf[n];
#ifdef TEST_BZERO
simple_bzero (tstbuf, n);
CALL (impl, s, n);
if (memcmp (s, tstbuf, n) != 0)
#else
CHAR *res = CALL (impl, s, c, n);
if (res != s
|| SIMPLE_MEMSET (tstbuf, c, n) != tstbuf
|| MEMCMP (s, tstbuf, n) != 0)
#endif /* !TEST_BZERO */
{
error (0, 0, "Wrong result in function %s", impl->name);
ret = 1;
return;
}
TIMING_NOW (start);
for (i = 0; i < iters; ++i)

View file

@ -203,9 +203,6 @@ test_init (void)
printf ("Setting seed to 0x%x\n", seed);
srandom (seed);
}
memset (buf1, 0xa5, BUF1PAGES * page_size);
memset (buf2, 0x5a, page_size);
}
#endif /* TEST_MAIN */