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>
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);
{
NFIXED_ITERS = 1048576,
NRAND_BUFS = 16384,
- NRAND_ITERS = 2048,
+ NRAND_ITERS = 256,
RAND_BENCH_MAX_LEN = 128
};
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);
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);
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);
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)
{
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);
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)
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);
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)
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))