#include "lib/getopt.h"
#include "lib/conf.h"
#include "lib/fastbuf.h"
+#include "lib/ff-binary.h"
#include "lib/hashfunc.h"
#include "lib/md5.h"
/*** Time measurement ***/
+static timestamp_t timer;
+
static void
start(void)
{
sync();
- init_timer();
+ init_timer(&timer);
}
static void
stop(void)
{
sync();
- log(L_INFO, "Test took %.3fs", get_timer() / 1000.);
+ msg(L_INFO, "Test took %.3fs", get_timer(&timer) / 1000.);
}
/*** Simple 4-byte integer keys ***/
{
uns N = size ? nextprime(MIN(size/4, 0xffff0000)) : 0;
uns K = N/4*3;
- log(L_INFO, ">>> Integers (%s, N=%u)", ((char *[]) { "increasing", "decreasing", "random" })[mode], N);
+ msg(L_INFO, ">>> Integers (%s, N=%u)", ((char *[]) { "increasing", "decreasing", "random" })[mode], N);
struct fastbuf *f = bopen_tmp(65536);
for (uns i=0; i<N; i++)
test_hashes(int mode, u64 size)
{
uns N = MIN(size / sizeof(struct key3), 0xffffffff);
- log(L_INFO, ">>> Hashes (%s, N=%u)", ((char *[]) { "increasing", "decreasing", "random" })[mode], N);
+ msg(L_INFO, ">>> Hashes (%s, N=%u)", ((char *[]) { "increasing", "decreasing", "random" })[mode], N);
struct key3 k, lastk;
struct fastbuf *f = bopen_tmp(65536);
{
uns avg_item_size = KEY4_MAX/2 + 4 + (mode ? 128 : 0);
uns N = MIN(size / avg_item_size, 0xffffffff);
- log(L_INFO, ">>> Strings %s(N=%u)", (mode ? "with data " : ""), N);
+ msg(L_INFO, ">>> Strings %s(N=%u)", (mode ? "with data " : ""), N);
srand(1);
struct key4 k, lastk;