summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-01-30 21:46:12 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-01-30 21:46:12 (GMT)
commit69a064eef8aeeba0090ccbe0914348daced513ff (patch)
tree0d28014056830d36758c0c6ca3d50061432453ae
parentf398fe6beefdd1d8bd7f34ec3ca9a17068c926a5 (diff)
downloadhdf5-69a064eef8aeeba0090ccbe0914348daced513ff.zip
hdf5-69a064eef8aeeba0090ccbe0914348daced513ff.tar.gz
hdf5-69a064eef8aeeba0090ccbe0914348daced513ff.tar.bz2
Increase iterations, provide a baseline for no-op, simplify the overhead
case a bit.
-rw-r--r--test/dtypes.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/dtypes.c b/test/dtypes.c
index 05da909..a12d204 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",