-/* $Id: benchisamb.c,v 1.4 2006-12-11 10:02:14 adam Exp $
- Copyright (C) 1995-2006
- Index Data ApS
-
-This file is part of the Zebra server.
+/* This file is part of the Zebra server.
+ Copyright (C) Index Data
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <yaz/options.h>
#if HAVE_SYS_TIMES_H
#include <sys/times.h>
#include <string.h>
#include <yaz/log.h>
#include <yaz/xmalloc.h>
+#include <yaz/timing.h>
#include <idzebra/isamb.h>
#include <assert.h>
ri.step = 1;
ri.insertMode = 1;
ri.sz = sizeof(int) + 1 + extra_size;
-
+
for (round = 0; round < number_of_rounds; round++)
{
- zebra_timing_t t = zebra_timing_create();
+ yaz_timing_t t = yaz_timing_create();
- zebra_timing_start(t);
+ yaz_timing_start(t);
for (i = 0; i<number_of_trees; i++)
{
/* insert a number of entries */
ri.no = 0;
-
+
ri.val = (rand());
- if (RAND_MAX < 65536)
+ if (RAND_MAX < 65536)
ri.val = ri.val + 65536*rand();
// ri.val = number_of_elements * round;
ri.max = number_of_elements;
-
+
isamc_i.clientData = &ri;
isamc_i.read_item = code_read;
-
+
isamb_merge (isb, &isamc_p[i] , &isamc_i);
if (0)
isamb_dump(isb, isamc_p[i], log_pr);
}
- zebra_timing_stop(t);
+ yaz_timing_stop(t);
printf("%3d %8.6f %5.2f %5.2f\n",
round+1,
- zebra_timing_get_real(t),
- zebra_timing_get_user(t),
- zebra_timing_get_sys(t));
- zebra_timing_destroy(&t);
+ yaz_timing_get_real(t),
+ yaz_timing_get_user(t),
+ yaz_timing_get_sys(t));
+ yaz_timing_destroy(&t);
}
xfree(isamc_p);
}
int number_of_items = 1000;
int number_of_isams = 1000;
int extra_size = 0;
- zebra_timing_t t = 0;
-
+ yaz_timing_t t = 0;
+
while ((ret = options("z:r:n:i:", argv, argc, &arg)) != -2)
{
switch(ret)
exit_usage();
}
}
-
+
/* setup method (attributes) */
method.compare_item = compare_item;
method.log_item = log_item;
method.codec.reset = code_reset;
method.codec.stop = code_stop;
- t = zebra_timing_create();
-
- zebra_timing_start(t);
+ t = yaz_timing_create();
+
+ yaz_timing_start(t);
/* create block system */
bfs = bfs_create(0, 0);
}
bench_insert(isb, number_of_isams, number_of_rounds, number_of_items,
extra_size);
-
+
isamb_close(isb);
/* exit block system */
bfs_destroy(bfs);
- zebra_timing_stop(t);
+ yaz_timing_stop(t);
printf("Total %8.6f %5.2f %5.2f\n",
- zebra_timing_get_real(t),
- zebra_timing_get_user(t),
- zebra_timing_get_sys(t));
- zebra_timing_destroy(&t);
+ yaz_timing_get_real(t),
+ yaz_timing_get_user(t),
+ yaz_timing_get_sys(t));
+ yaz_timing_destroy(&t);
exit(0);
return 0;
}
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab