From 1dec188ccbdafb0ec7b7c98857d701a7b77d46a1 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 19 Jun 2002 10:29:17 +0000 Subject: [PATCH] align block sizes for isam sys. Better plot for test --- index/invstat.c | 47 +++++++++++++++++++++++++---------------------- isamb/isamb.c | 6 +++--- isamc/isamc.c | 7 +++++-- isamc/isamd.c | 9 ++++++--- test/dmoz/all.sh | 3 +-- test/dmoz/plot.dem | 16 ++-------------- test/dmoz/update.sh | 26 +++++++++++++++++++++----- 7 files changed, 63 insertions(+), 51 deletions(-) diff --git a/index/invstat.c b/index/invstat.c index 8e5770a..dd808da 100644 --- a/index/invstat.c +++ b/index/invstat.c @@ -216,26 +216,26 @@ void zebra_register_statistics (ZebraHandle zh) if (zh->reg->isamc) { - fprintf (stderr, " Blocks Occur Size KB Bytes/Entry\n"); + fprintf (stdout, " Blocks Occur Size KB Bytes/Entry\n"); for (i = 0; isc_block_used (zh->reg->isamc, i) >= 0; i++) { - fprintf (stderr, " %8d %8d", isc_block_used (zh->reg->isamc, i), + fprintf (stdout, " %8d %8d", isc_block_used (zh->reg->isamc, i), stat_info.no_isam_entries[i]); if (stat_info.no_isam_entries[i]) - fprintf (stderr, " %8d %f", + fprintf (stdout, " %8d %f", (int) ((1023.0 + (double) isc_block_used(zh->reg->isamc, i) * isc_block_size(zh->reg->isamc,i))/1024), ((double) isc_block_used(zh->reg->isamc, i) * isc_block_size(zh->reg->isamc,i))/ stat_info.no_isam_entries[i]); - fprintf (stderr, "\n"); + fprintf (stdout, "\n"); } } if (zh->reg->isamd) { - fprintf (stderr, " Blocks Occur KB Bytes/Entry\n"); + fprintf (stdout, " Blocks Occur KB Bytes/Entry\n"); if (zh->reg->isamd->method->debug >0) logf(LOG_LOG," Blocks Occur KB Bytes/Entry"); for (i = 0; i<=SINGLETON_TYPE; i++) @@ -247,7 +247,7 @@ void zebra_register_statistics (ZebraHandle zh) blocks=size=0; if (stat_info.no_isam_entries[i]) { - fprintf (stderr, "%c %7d %7d %7d %5.2f\n", + fprintf (stdout, "%c %7d %7d %7d %5.2f\n", (i==SINGLETON_TYPE)?('z'):('A'+i), blocks, count, @@ -264,7 +264,7 @@ void zebra_register_statistics (ZebraHandle zh) } /* for */ } /* isamd */ if ( (zh->reg->isamd) && (zh->reg->isamd->method->debug>0)) - fprintf (stderr, "\n%d words using %d bytes\n", + fprintf (stdout, "\n%d words using %d bytes\n", stat_info.no_dict_entries, stat_info.no_dict_bytes); if (zh->reg->isamb) @@ -275,37 +275,37 @@ void zebra_register_statistics (ZebraHandle zh) int bsize = isamb_block_info(zh->reg->isamb, i); if (bsize < 0) break; - fprintf (stderr, "Category %d\n", i); - fprintf (stderr, "Block size %d\n", bsize); - fprintf (stderr, "Blocks: %d\n", stat_info.isamb_blocks[i]); - fprintf (stderr, "Size: %d\n", stat_info.isamb_sizes[i]); - fprintf (stderr, "Entries: %d\n", stat_info.no_isam_entries[i]); - fprintf (stderr, "Total %d\n", stat_info.isamb_blocks[i]* + fprintf (stdout, "Category %d\n", i); + fprintf (stdout, "Block size %d\n", bsize); + fprintf (stdout, "Blocks: %d\n", stat_info.isamb_blocks[i]); + fprintf (stdout, "Size: %d\n", stat_info.isamb_sizes[i]); + fprintf (stdout, "Entries: %d\n", stat_info.no_isam_entries[i]); + fprintf (stdout, "Total %d\n", stat_info.isamb_blocks[i]* bsize); for (j = 0; j<5; j++) if (stat_info.isamb_levels[i][j]) - fprintf (stderr, "Level%d %d\n", j, + fprintf (stdout, "Level%d %d\n", j, stat_info.isamb_levels[i][j]); - fprintf (stderr, "\n"); + fprintf (stdout, "\n"); } } - fprintf (stderr, "Checksum %08lX\n", stat_info.cksum); + fprintf (stdout, "Checksum %08lX\n", stat_info.cksum); - fprintf (stderr, "Distinct words %d\n", stat_info.no_dict_entries); + fprintf (stdout, "Distinct words %d\n", stat_info.no_dict_entries); occur = 0; for (i = 0; i<9; i++) occur += stat_info.no_isam_entries[i]; - fprintf (stderr, "Word pos %d\n", occur); - fprintf (stderr, " Occurrences Words\n"); + fprintf (stdout, "Word pos %d\n", occur); + fprintf (stdout, " Occurrences Words\n"); prev = 1; for (i = 0; stat_info.isam_bounds[i]; i++) { int here = stat_info.isam_bounds[i]; - fprintf (stderr, "%7d-%-7d %7d\n", + fprintf (stdout, "%7d-%-7d %7d\n", prev, here, stat_info.isam_occurrences[i]); prev = here+1; } - fprintf (stderr, "%7d- %7d\n", + fprintf (stdout, "%7d- %7d\n", prev, stat_info.isam_occurrences[i]); xmalloc_trav("unfreed"); /*! while hunting memory leaks */ zebra_end_read (zh); @@ -315,7 +315,10 @@ void zebra_register_statistics (ZebraHandle zh) /* * * $Log: invstat.c,v $ - * Revision 1.28 2002-04-30 19:31:09 adam + * Revision 1.29 2002-06-19 10:29:17 adam + * align block sizes for isam sys. Better plot for test + * + * Revision 1.28 2002/04/30 19:31:09 adam * isamb delete; more statistics * * Revision 1.27 2002/04/30 08:28:37 adam diff --git a/isamb/isamb.c b/isamb/isamb.c index cd36e37..343e5e3 100644 --- a/isamb/isamb.c +++ b/isamb/isamb.c @@ -2,7 +2,7 @@ * Copyright (c) 2000-2002, Index Data. * See the file LICENSE for details. * - * $Id: isamb.c,v 1.16 2002-05-30 13:22:17 adam Exp $ + * $Id: isamb.c,v 1.17 2002-06-19 10:29:17 adam Exp $ */ #include #include @@ -74,12 +74,12 @@ void decode_ptr (char **src, int *pos) ISAMB isamb_open (BFiles bfs, const char *name, int writeflag, ISAMC_M method) { ISAMB isamb = xmalloc (sizeof(*isamb)); - int i, b_size = 64; + int i, b_size = 32; isamb->bfs = bfs; isamb->method = (ISAMC_M) xmalloc (sizeof(*method)); memcpy (isamb->method, method, sizeof(*method)); - isamb->no_cat = 3; + isamb->no_cat = 4; isamb->file = xmalloc (sizeof(*isamb->file) * isamb->no_cat); for (i = 0; ino_cat; i++) diff --git a/isamc/isamc.c b/isamc/isamc.c index 28b71ce..d8938a2 100644 --- a/isamc/isamc.c +++ b/isamc/isamc.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: isamc.c,v $ - * Revision 1.20 1999-11-30 13:48:04 adam + * Revision 1.21 2002-06-19 10:29:18 adam + * align block sizes for isam sys. Better plot for test + * + * Revision 1.20 1999/11/30 13:48:04 adam * Improved installation. Updated for inclusion of YAZ header files. * * Revision 1.19 1999/07/14 10:59:27 adam @@ -106,7 +109,7 @@ void isc_getmethod (ISAMC_M m) { 32, 28, 0, 3 }, { 64, 54, 30, 0 }, #else - { 24, 22, 18, 10 }, + { 32, 26, 20, 10 }, { 128, 120, 100, 10 }, { 512, 490, 350, 10 }, { 2048, 1900, 1700, 10 }, diff --git a/isamc/isamd.c b/isamc/isamd.c index 7333d31..13754fb 100644 --- a/isamc/isamd.c +++ b/isamc/isamd.c @@ -1,7 +1,7 @@ /* * Copyright (c) 1995-1998, Index Data. * See the file LICENSE for details. - * $Id: isamd.c,v 1.19 1999-11-30 13:48:04 adam Exp $ + * $Id: isamd.c,v 1.20 2002-06-19 10:29:18 adam Exp $ * * Isamd - isam with diffs * Programmed by: Heikki Levanto @@ -37,7 +37,7 @@ ISAMD_M isamd_getmethod (ISAMD_M me) { 32, 40 }, /* 24 is the smallest unreasonable size! */ { 64, 0 }, #else - { 64, 1 }, + { 32, 1 }, { 128, 1 }, { 256, 1 }, { 512, 1 }, @@ -850,7 +850,10 @@ void isamd_pp_dump (ISAMD is, ISAMD_P ipos) /* * $Log: isamd.c,v $ - * Revision 1.19 1999-11-30 13:48:04 adam + * Revision 1.20 2002-06-19 10:29:18 adam + * align block sizes for isam sys. Better plot for test + * + * Revision 1.19 1999/11/30 13:48:04 adam * Improved installation. Updated for inclusion of YAZ header files. * * Revision 1.18 1999/10/06 15:18:13 heikki diff --git a/test/dmoz/all.sh b/test/dmoz/all.sh index 07cff84..262b53c 100755 --- a/test/dmoz/all.sh +++ b/test/dmoz/all.sh @@ -1,6 +1,5 @@ #!/bin/sh -# $Id: all.sh,v 1.3 2002-06-19 09:00:28 adam Exp $ +# $Id: all.sh,v 1.4 2002-06-19 10:29:18 adam Exp $ ./update.sh b ./update.sh c ./update.sh d -gnuplot plot.dem diff --git a/test/dmoz/plot.dem b/test/dmoz/plot.dem index 9b8c294..1454213 100755 --- a/test/dmoz/plot.dem +++ b/test/dmoz/plot.dem @@ -1,18 +1,6 @@ set xlabel "runs" set ylabel "seconds" -plot [0:] [0:] \ - 'times-b.log' using 3 title 'ISAMB(user)' with linespoints, \ - 'times-b.log' using 2 title 'ISAMB(total)' with linespoints, \ - 'times-c.log' using 3 title 'ISAMC(user)' with linespoints, \ - 'times-c.log' using 2 title 'ISAMC(total)' with linespoints, \ - 'times-d.log' using 3 title 'ISAMD(user)' with linespoints, \ - 'times-d.log' using 2 title 'ISAMD(total)' with linespoints -set output "times.ps" +plot [0:] [0:] 'times-b.log' using 2 title 'ISAM-b(real)' with linespoints, 'times-b.log' using 3 title 'ISAM-b(user)' with linespoints, 'times-b.log' using 4 title 'ISAM-b(sys)' with linespoints +set output "times-b.ps" set terminal postscript replot -set output -set terminal x11 -pause -1 "Hit return to continue" - - - diff --git a/test/dmoz/update.sh b/test/dmoz/update.sh index f8a0872..e99e2bb 100755 --- a/test/dmoz/update.sh +++ b/test/dmoz/update.sh @@ -1,17 +1,33 @@ #!/bin/sh -# $Id: update.sh,v 1.2 2002-06-19 08:32:34 adam Exp $ +# $Id: update.sh,v 1.3 2002-06-19 10:29:18 adam Exp $ t=$1 test -n "$t" || exit 1 rm -f *.mf *.LCK *.tmp ../../index/zebraidx -l zebraidx.log init i=0 -rm -f times-$t.log zebraidx-$t.log +rm -f times-$t.log zebraidx-$t.log stat-$t.log while test -f dmoz.$i.xml; do echo -n "$i " >>times-$1.log - /usr/bin/time -f '%e %U %P' -a -o times-$t.log ../../index/zebraidx -l zebraidx-$t.log -c zebra-$t.cfg -f 10 update dmoz.$i.xml - ../../index/zebraidx -l zebraidx-$t.log -c zebra-$t.cfg stat + /usr/bin/time -f '%e %U %S %P' -a -o times-$t.log ../../index/zebraidx -l zebraidx-$t.log -c zebra-$t.cfg -f 10 update dmoz.$i.xml + ../../index/zebraidx -l zebraidx-$t.log -c zebra-$t.cfg stat >>stat-$t.log i=`expr $i + 1` - if test $i = 29; then + if test $i = 30; then break fi done + +cat >plot.dem <