X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=isamb%2Fbenchisamb.c;h=7edda40b8e6a44ef0315f0e3fb89e1d69c5e75e0;hp=396adc28a612c83b0dc599344001bc4aa7d575eb;hb=07bf59c106e8d2492c5743019c2932a001e48181;hpb=ae5c8868f2bee81cebddf3251432eb47c3da3591 diff --git a/isamb/benchisamb.c b/isamb/benchisamb.c index 396adc2..7edda40 100644 --- a/isamb/benchisamb.c +++ b/isamb/benchisamb.c @@ -1,8 +1,5 @@ -/* $Id: benchisamb.c,v 1.5 2007-01-05 10:45:12 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) 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 @@ -20,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 @@ -132,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(); @@ -143,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) @@ -188,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) @@ -213,7 +213,7 @@ int main(int argc, char **argv) exit_usage(); } } - + /* setup method (attributes) */ method.compare_item = compare_item; method.log_item = log_item; @@ -224,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 */ @@ -246,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 */ @@ -264,6 +264,7 @@ int main(int argc, char **argv) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab