From 4eaf00a0af4c40bd166e2224964319a58efafeaa Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 7 Dec 2006 21:13:56 +0000 Subject: [PATCH] Added some ISAMB benchmark code --- isamb/tstisamb.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 4 deletions(-) diff --git a/isamb/tstisamb.c b/isamb/tstisamb.c index 873d0cf..4103211 100644 --- a/isamb/tstisamb.c +++ b/isamb/tstisamb.c @@ -1,4 +1,4 @@ -/* $Id: tstisamb.c,v 1.25 2006-10-30 16:21:29 adam Exp $ +/* $Id: tstisamb.c,v 1.26 2006-12-07 21:13:56 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -20,6 +20,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_SYS_TIMES_H +#include +#endif +#if HAVE_SYS_TIME_H +#include +#endif + #include #include #include @@ -96,12 +103,71 @@ int code_read(void *vp, char **dst, int *insertMode) ri->val = ri->val + ri->step; *insertMode = ri->insertMode; -#if 1 - yaz_log(YLOG_DEBUG, "%d %5d", ri->insertMode, x); +#if 0 + yaz_log(YLOG_LOG, "%d %5d", ri->insertMode, x); #endif return 1; } +void bench_insert(ISAMB isb, int number_of_trees, + int number_of_rounds, int number_of_elements) +{ + ISAMC_I isamc_i; + ISAM_P *isamc_p = xmalloc(sizeof(ISAM_P) * number_of_trees); + struct read_info ri; + int round, i; + + for (i = 0; i