projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version 2.0.61
[idzebra-moved-to-github.git]
/
isamb
/
benchisamb.c
diff --git
a/isamb/benchisamb.c
b/isamb/benchisamb.c
index
d56bd74
..
9f5ba9a
100644
(file)
--- a/
isamb/benchisamb.c
+++ b/
isamb/benchisamb.c
@@
-1,5
+1,5
@@
/* This file is part of the Zebra server.
/* This file is part of the Zebra server.
- Copyright (C) 1994-2011 Index Data
+ 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
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
@@
-17,6
+17,9
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <yaz/options.h>
#if HAVE_SYS_TIMES_H
#include <sys/times.h>
#include <yaz/options.h>
#if HAVE_SYS_TIMES_H
#include <sys/times.h>
@@
-129,7
+132,7
@@
void bench_insert(ISAMB isb, int number_of_trees,
ri.step = 1;
ri.insertMode = 1;
ri.sz = sizeof(int) + 1 + extra_size;
ri.step = 1;
ri.insertMode = 1;
ri.sz = sizeof(int) + 1 + extra_size;
-
+
for (round = 0; round < number_of_rounds; round++)
{
yaz_timing_t t = yaz_timing_create();
for (round = 0; round < number_of_rounds; round++)
{
yaz_timing_t t = yaz_timing_create();
@@
-140,17
+143,17
@@
void bench_insert(ISAMB isb, int number_of_trees,
/* insert a number of entries */
ri.no = 0;
/* insert a number of entries */
ri.no = 0;
-
+
ri.val = (rand());
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;
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;
isamc_i.clientData = &ri;
isamc_i.read_item = code_read;
-
+
isamb_merge (isb, &isamc_p[i] , &isamc_i);
if (0)
isamb_merge (isb, &isamc_p[i] , &isamc_i);
if (0)
@@
-185,7
+188,7
@@
int main(int argc, char **argv)
int number_of_isams = 1000;
int extra_size = 0;
yaz_timing_t t = 0;
int number_of_isams = 1000;
int extra_size = 0;
yaz_timing_t t = 0;
-
+
while ((ret = options("z:r:n:i:", argv, argc, &arg)) != -2)
{
switch(ret)
while ((ret = options("z:r:n:i:", argv, argc, &arg)) != -2)
{
switch(ret)
@@
-210,7
+213,7
@@
int main(int argc, char **argv)
exit_usage();
}
}
exit_usage();
}
}
-
+
/* setup method (attributes) */
method.compare_item = compare_item;
method.log_item = log_item;
/* setup method (attributes) */
method.compare_item = compare_item;
method.log_item = log_item;
@@
-221,7
+224,7
@@
int main(int argc, char **argv)
method.codec.stop = code_stop;
t = yaz_timing_create();
method.codec.stop = code_stop;
t = yaz_timing_create();
-
+
yaz_timing_start(t);
/* create block system */
yaz_timing_start(t);
/* create block system */
@@
-243,7
+246,7
@@
int main(int argc, char **argv)
}
bench_insert(isb, number_of_isams, number_of_rounds, number_of_items,
extra_size);
}
bench_insert(isb, number_of_isams, number_of_rounds, number_of_items,
extra_size);
-
+
isamb_close(isb);
/* exit block system */
isamb_close(isb);
/* exit block system */