Branch and cache miss speedups
[fio.git] / gettime.c
index 1a0f827460c9da6562678733f041be73c2eec484..8991703fd0662fad4616ed8ab66f154f12c0ade9 100644 (file)
--- a/gettime.c
+++ b/gettime.c
@@ -205,7 +205,7 @@ void fio_gettime(struct timeval *tp, void fio_unused *caller)
 
        gtod_log_caller(caller);
 #endif
-       if (fio_tv) {
+       if (fio_unlikely(fio_tv)) {
                memcpy(tp, fio_tv, sizeof(*tp));
                return;
        }
@@ -327,7 +327,7 @@ void fio_local_clock_init(int is_thread)
 {
        struct tv_valid *t;
 
-       t = calloc(sizeof(*t), 1);
+       t = calloc(1, sizeof(*t));
        if (pthread_setspecific(tv_tls_key, t))
                log_err("fio: can't set TLS key\n");
 }