mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-23 09:43:32 +08:00
Benchtests: Adjust timing
Adjust iteration counts so benchmarks don't run too slowly or quickly. Ensure benchmarks take less than 10 seconds on older, slower cores and more than 0.5 seconds on fast cores. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
e275690332
commit
2623479105
@ -51,7 +51,7 @@ IMPL (memset_zero, 0)
|
||||
static void
|
||||
do_one_test (json_ctx_t *json_ctx, impl_t *impl, CHAR *s, size_t n)
|
||||
{
|
||||
size_t i, iters = INNER_LOOP_ITERS_LARGE;
|
||||
size_t i, iters = INNER_LOOP_ITERS8;
|
||||
timing_t start, stop, cur;
|
||||
|
||||
TIMING_NOW (start);
|
||||
|
@ -42,7 +42,7 @@ enum
|
||||
{
|
||||
NFIXED_ITERS = 1048576,
|
||||
NRAND_BUFS = 16384,
|
||||
NRAND_ITERS = 2048,
|
||||
NRAND_ITERS = 256,
|
||||
RAND_BENCH_MAX_LEN = 128
|
||||
};
|
||||
|
||||
|
@ -41,7 +41,7 @@ static void
|
||||
do_one_test (impl_t *impl, void *dst, const void *src, int c, size_t len,
|
||||
size_t n)
|
||||
{
|
||||
size_t i, iters = INNER_LOOP_ITERS_LARGE;
|
||||
size_t i, iters = INNER_LOOP_ITERS_LARGE * 4;
|
||||
timing_t start, stop, cur;
|
||||
|
||||
TIMING_NOW (start);
|
||||
|
@ -51,7 +51,7 @@ static void
|
||||
do_one_test (json_ctx_t *json_ctx, impl_t *impl, const CHAR *s, int c,
|
||||
size_t n)
|
||||
{
|
||||
size_t i, iters = INNER_LOOP_ITERS;
|
||||
size_t i, iters = INNER_LOOP_ITERS8 / 2;
|
||||
timing_t start, stop, cur;
|
||||
|
||||
TIMING_NOW (start);
|
||||
|
@ -127,7 +127,7 @@ do_one_test (json_ctx_t *json_ctx, impl_t *impl, char *dst, char *src,
|
||||
copy_t *copy, size_t n)
|
||||
{
|
||||
timing_t start, stop, cur;
|
||||
size_t iters = INNER_LOOP_ITERS_MEDIUM;
|
||||
size_t iters = INNER_LOOP_ITERS_MEDIUM / 2;
|
||||
|
||||
for (int j = 0; j < n; j++)
|
||||
CALL (impl, dst + copy[j].dst, src + copy[j].src, copy[j].len);
|
||||
|
@ -38,7 +38,7 @@ static void
|
||||
do_one_test (json_ctx_t *json_ctx, impl_t *impl, char *dst, const char *src,
|
||||
size_t len)
|
||||
{
|
||||
size_t i, iters = INNER_LOOP_ITERS;
|
||||
size_t i, iters = INNER_LOOP_ITERS / 2;
|
||||
timing_t start, stop, cur;
|
||||
for (i = 0; i < iters / 64; ++i)
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ static void
|
||||
do_one_test (json_ctx_t *json_ctx, impl_t *impl, CHAR *s,
|
||||
int c __attribute ((unused)), size_t n)
|
||||
{
|
||||
size_t i, iters = INNER_LOOP_ITERS_LARGE;
|
||||
size_t i, iters = INNER_LOOP_ITERS;
|
||||
timing_t start, stop, cur;
|
||||
|
||||
TIMING_NOW (start);
|
||||
|
@ -52,7 +52,7 @@ IMPL (generic_strcat, 0)
|
||||
static void
|
||||
do_one_test (json_ctx_t *json_ctx, impl_t *impl, CHAR *dst, const CHAR *src)
|
||||
{
|
||||
size_t k = STRLEN (dst), i, iters = INNER_LOOP_ITERS_LARGE;
|
||||
size_t k = STRLEN (dst), i, iters = INNER_LOOP_ITERS_LARGE / CHARBYTES;
|
||||
timing_t start, stop, cur;
|
||||
|
||||
if (CALL (impl, dst, src) != dst)
|
||||
|
@ -50,7 +50,7 @@ do_one_test (json_ctx_t *json_ctx, impl_t *impl,
|
||||
const CHAR *s1, const CHAR *s2,
|
||||
int exp_result)
|
||||
{
|
||||
size_t i, iters = INNER_LOOP_ITERS;
|
||||
size_t i, iters = INNER_LOOP_ITERS8 / 2;
|
||||
timing_t start, stop, cur;
|
||||
|
||||
TIMING_NOW (start);
|
||||
|
@ -48,7 +48,7 @@ IMPL (STRLEN, 1)
|
||||
static void
|
||||
do_one_test (json_ctx_t *json_ctx, impl_t *impl, const CHAR *s, size_t exp_len)
|
||||
{
|
||||
size_t len = CALL (impl, s), i, iters = INNER_LOOP_ITERS8;
|
||||
size_t len = CALL (impl, s), i, iters = INNER_LOOP_ITERS_LARGE;
|
||||
timing_t start, stop, cur;
|
||||
|
||||
if (len != exp_len)
|
||||
|
@ -57,7 +57,7 @@ static void
|
||||
do_one_test (json_ctx_t *json_ctx, impl_t *impl, CHAR *dst, const CHAR *src,
|
||||
size_t len, size_t n)
|
||||
{
|
||||
size_t i, iters = INNER_LOOP_ITERS_LARGE * (4 / CHARBYTES);
|
||||
size_t i, iters = INNER_LOOP_ITERS_LARGE / CHARBYTES;
|
||||
timing_t start, stop, cur;
|
||||
|
||||
if (CALL (impl, dst, src, n) != STRNCPY_RESULT (dst, len, n))
|
||||
|
Loading…
Reference in New Issue
Block a user