summaryrefslogtreecommitdiffstats
path: root/test/dtypes.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-01-30 21:46:12 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-05-20 14:31:54 (GMT)
commit17f8b2913b81f0ba504d6cde0c6733b160bb11db (patch)
tree8c3f9d437f725a54e4a3cc0dc65d82b27f5f53c1 /test/dtypes.c
parent66334f899d19edc01cf83bebbc6dcec914b3dfa3 (diff)
downloadhdf5-17f8b2913b81f0ba504d6cde0c6733b160bb11db.zip
hdf5-17f8b2913b81f0ba504d6cde0c6733b160bb11db.tar.gz
hdf5-17f8b2913b81f0ba504d6cde0c6733b160bb11db.tar.bz2
Increase iterations, provide a baseline for no-op, simplify the overhead
case a bit.
Diffstat (limited to 'test/dtypes.c')
-rw-r--r--test/dtypes.c14
1 files 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",