First step at speeding up io_u rand refill
Makes it 3x faster here.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/io_u.c b/io_u.c
index afc90de..4d3116b 100644
--- a/io_u.c
+++ b/io_u.c
@@ -8,6 +8,7 @@
#include "fio.h"
#include "hash.h"
#include "verify.h"
+#include "lib/rand.h"
struct io_completion_data {
int nr; /* input */
@@ -1217,7 +1218,7 @@
if (!td->o.zero_buffers) {
while ((void *) ptr - io_u->buf < max_bs) {
- *ptr = rand() * GOLDEN_RATIO_PRIME;
+ *ptr = __rand(&__fio_rand_state);
ptr++;
}
} else