X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=isamb%2Fbenchisamb.c;h=7edda40b8e6a44ef0315f0e3fb89e1d69c5e75e0;hp=39f46cba69d06a1b9df5b6a0b3224819e186f459;hb=1d5d4f08cb84516d75fcb5e6ed4199b6454cccd6;hpb=a66b7d79383ae700f3358731eecfe2aafed0e90d diff --git a/isamb/benchisamb.c b/isamb/benchisamb.c index 39f46cb..7edda40 100644 --- a/isamb/benchisamb.c +++ b/isamb/benchisamb.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 1994-2010 Index Data + Copyright (C) 2004-2013 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 @@ -17,6 +17,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_CONFIG_H +#include +#endif #include #if HAVE_SYS_TIMES_H #include @@ -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; - + 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; - + 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) @@ -185,7 +188,7 @@ int main(int argc, char **argv) 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) @@ -210,7 +213,7 @@ int main(int argc, char **argv) exit_usage(); } } - + /* 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(); - + 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); - + isamb_close(isb); /* exit block system */