From 17f8b2913b81f0ba504d6cde0c6733b160bb11db Mon Sep 17 00:00:00 2001 From: David Young Date: Thu, 30 Jan 2020 15:46:12 -0600 Subject: Increase iterations, provide a baseline for no-op, simplify the overhead case a bit. --- test/dtypes.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/dtypes.c b/test/dtypes.c index 25a3088..6e3c070 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -7819,7 +7819,7 @@ herr_t no_operation(H5T_t *t, int mode); herr_t H5T__forward_args_with_func_overhead(H5T_t *t); herr_t H5T__forward_args_without_func_overhead(H5T_t *t); -herr_t +herr_t __attribute__((noinline)) H5T__forward_args_with_func_overhead(H5T_t *t) { herr_t ret_value = FAIL; @@ -7829,12 +7829,11 @@ H5T__forward_args_with_func_overhead(H5T_t *t) if ((ret_value = no_operation(t, 10)) == FAIL) HGOTO_ERROR(17, 31, FAIL, "that didn't work"); - ret_value = SUCCEED; done: FUNC_LEAVE_NOAPI(ret_value) } -herr_t +herr_t __attribute__((noinline)) H5T__forward_args_without_func_overhead(H5T_t *t) { return no_operation(t, 10); @@ -7862,7 +7861,7 @@ main(void) long nerrors = 0; hid_t fapl = -1; H5T_t *t; - int i, ntimes = 10 * 1000 * 1000; + int i, ntimes = 100 * 1000 * 1000; uint64_t start, stop; /* Set the random # seed */ @@ -7879,6 +7878,13 @@ main(void) start = __builtin_ia32_rdtsc(); for (i = 0; i < ntimes; i++) + no_operation(t, 10); + stop = __builtin_ia32_rdtsc(); + printf("%d calls to no-op routine, %" PRIu64 " cycles\n", + ntimes, stop - start); + + start = __builtin_ia32_rdtsc(); + for (i = 0; i < ntimes; i++) H5T__forward_args_without_func_overhead(t); stop = __builtin_ia32_rdtsc(); printf("%d calls to no-overhead version, %" PRIu64 " cycles\n", -- cgit v0.12