X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=isamb%2Fbenchindex1.c;h=1ba900c2dacb01ed63edd9c0125a8d40e2c5a9f7;hb=161aa7805930f6b91ccea027e4afa4ccce41c379;hp=00e1ddd76d7315fbca1c0762142ea247621ea056;hpb=0152d93e3eb697047545f4f6eec0b8c63cae4d1c;p=idzebra-moved-to-github.git diff --git a/isamb/benchindex1.c b/isamb/benchindex1.c index 00e1ddd..1ba900c 100644 --- a/isamb/benchindex1.c +++ b/isamb/benchindex1.c @@ -1,4 +1,4 @@ -/* $Id: benchindex1.c,v 1.5 2006-12-12 13:51:23 adam Exp $ +/* $Id: benchindex1.c,v 1.7 2006-12-12 17:33:35 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -217,12 +217,12 @@ void index_block_flush(struct index_block *b, ISAMB isb, Dict dict, if (b->round == 0) { printf("# run total dict-real user sys isam-real user sys " - " intsp leafsp docs postings words new d-spl\n"); + " intsp leafsp docs postings words new d-spl\n"); } b->round++; printf("%5d %9.6f %9.6f %5.2f %5.2f %9.6f %5.2f %5.2f " "%6" ZINT_FORMAT0 " %6" ZINT_FORMAT0 - " %5d %8d %6d %6d" " %5" ZINT_FORMAT0 "\n", + " %8d %8d %6d %6d" " %5" ZINT_FORMAT0 "\n", b->round, zebra_timing_get_real(tim_dict) + zebra_timing_get_real(tim_isamb), zebra_timing_get_real(tim_dict), @@ -503,8 +503,8 @@ void exit_usage(void) int main(int argc, char **argv) { BFiles bfs; - ISAMB isb; - ISAMC_M method; + ISAMB isb_postings; + ISAMC_M method_postings; Dict dict; int ret; int reset = 0; @@ -575,18 +575,18 @@ int main(int argc, char **argv) printf("# dict_cache_size = %d\n", dict_cache_size); printf("# int_count_enable = %d\n", int_count_enable); printf("# memory = %d\n", memory); - - /* setup method (attributes) */ - method.compare_item = key_compare; - method.log_item = key_logdump_txt; - method.codec.start = iscz1_start; - method.codec.decode = iscz1_decode; - method.codec.encode = iscz1_encode; - method.codec.stop = iscz1_stop; - method.codec.reset = iscz1_reset; + /* setup postings isamb attributes */ + method_postings.compare_item = key_compare; + method_postings.log_item = key_logdump_txt; + + method_postings.codec.start = iscz1_start; + method_postings.codec.decode = iscz1_decode; + method_postings.codec.encode = iscz1_encode; + method_postings.codec.stop = iscz1_stop; + method_postings.codec.reset = iscz1_reset; - method.debug = 0; + method_postings.debug = 0; /* create block system */ bfs = bfs_create(0, 0); @@ -601,14 +601,15 @@ int main(int argc, char **argv) tim = zebra_timing_create(); /* create isam handle */ - isb = isamb_open (bfs, "isamb", isam_cache_size ? 1 : 0, &method, 0); - if (!isb) + isb_postings = isamb_open (bfs, "isamb", isam_cache_size ? 1 : 0, + &method_postings, 0); + if (!isb_postings) { yaz_log(YLOG_WARN, "isamb_open failed"); exit(2); } - isamb_set_cache_size(isb, isam_cache_size); - isamb_set_int_count(isb, int_count_enable); + isamb_set_cache_size(isb_postings, isam_cache_size); + isamb_set_int_count(isb_postings, int_count_enable); dict = dict_open(bfs, "dict", dict_cache_size, 1, 0, 4096); dict_info = dict_lookup(dict, "_s"); @@ -619,16 +620,16 @@ int main(int argc, char **argv) } if (!strcmp(type, "iso2709")) - index_marc_from_file(isb, dict, &docid_seq, inf, memory, + index_marc_from_file(isb_postings, dict, &docid_seq, inf, memory, 0 /* verbose */ , 0 /* print_offset */); else if (!strcmp(type, "line")) - index_marc_line_records(isb, dict, &docid_seq, inf, memory); + index_marc_line_records(isb_postings, dict, &docid_seq, inf, memory); printf("# Total " ZINT_FORMAT " documents\n", docid_seq); dict_insert(dict, "_s", sizeof(docid_seq), &docid_seq); dict_close(dict); - isamb_close(isb); + isamb_close(isb_postings); if (fname) fclose(inf);