Move some memory related activities outside of the timed block

This commit is contained in:
A.J. Beamon 2017-08-09 14:36:19 -07:00
parent 5a8cd34224
commit 853a98053c
1 changed files with 5 additions and 6 deletions

View File

@ -234,10 +234,10 @@ struct RunResult parallelGet(struct ResultSet *rs, FDBTransaction *tr) {
fdb_error_t e = maybeLogError(setRetryLimit(rs, tr, 5), "setting retry limit", rs);
if(e) return RES(0, e);
double start = getTime();
FDBFuture **futures = (FDBFuture**)malloc((sizeof(FDBFuture*)) * PARALLEL_GET_COUNT);
double start = getTime();
int i;
for(i = 0; i < PARALLEL_GET_COUNT; i++) {
int k = ((uint64_t)rand()) % numKeys;
@ -276,10 +276,10 @@ struct RunResult alternatingGetSet(struct ResultSet *rs, FDBTransaction *tr) {
fdb_error_t e = maybeLogError(setRetryLimit(rs, tr, 5), "setting retry limit", rs);
if(e) return RES(0, e);
double start = getTime();
FDBFuture **futures = (FDBFuture**)malloc((sizeof(FDBFuture*)) * ALTERNATING_GET_SET_COUNT);
double start = getTime();
int i;
for(i = 0; i < ALTERNATING_GET_SET_COUNT; i++) {
int k = ((uint64_t)rand()) % numKeys;
@ -372,10 +372,9 @@ struct RunResult serialGet(struct ResultSet *rs, FDBTransaction *tr) {
}
}
free(keyIndices);
double end = getTime();
free(keyIndices);
return RES(SERIAL_GET_COUNT/(end - start), 0);
}