summaryrefslogtreecommitdiffstats
path: root/perform
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2002-06-12 15:56:10 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2002-06-12 15:56:10 (GMT)
commit3bbc9285cf7bda368f18cc724f14edcf2828a0ea (patch)
treec0e496ac724a239cdbbfc42cc651cfe1646a4c31 /perform
parent1b082cf2c20eecc1ac91e3489bfc6105d05a3f48 (diff)
downloadhdf5-3bbc9285cf7bda368f18cc724f14edcf2828a0ea.zip
hdf5-3bbc9285cf7bda368f18cc724f14edcf2828a0ea.tar.gz
hdf5-3bbc9285cf7bda368f18cc724f14edcf2828a0ea.tar.bz2
[svn-r5601] Purpose:
More Output Description: Added some more output, including the compression ratio. Platforms tested: Linux, FreeBSD
Diffstat (limited to 'perform')
-rw-r--r--perform/zip_perf.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/perform/zip_perf.c b/perform/zip_perf.c
index 614f5a1..26b0ea4 100644
--- a/perform/zip_perf.c
+++ b/perform/zip_perf.c
@@ -89,6 +89,7 @@ static const char *option_prefix;
static char *filename;
static int compress_level = Z_DEFAULT_COMPRESSION;
static int output, random_test = FALSE;
+static int report_once_flag;
/* internal functions */
static void error(const char *fmt, ...);
@@ -194,6 +195,11 @@ write_file(Bytef *source, uLongf sourceLen)
compress_buffer(dest, &destLen, source, sourceLen);
+ if (report_once_flag) {
+ printf("\tCompression Ratio: %g\n", ((double)destLen) / sourceLen);
+ report_once_flag = 0;
+ }
+
d_ptr = dest;
d_len = destLen;
@@ -462,6 +468,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size,
if (output == -1)
error(strerror(errno));
+ report_once_flag = 1;
for (total_len = 0; total_len < file_size; total_len += src_len)
write_file(src, src_len);
@@ -537,13 +544,20 @@ main(int argc, char **argv)
error("minmum buffer size (%d) exceeds maximum buffer size (%d)",
min_buf_size, max_buf_size);
+ printf("Filesize: %ld\n", file_size);
+
+ if (compress_level == Z_DEFAULT_COMPRESSION)
+ printf("Compression Level: 6\n");
+ else
+ printf("Compression Level: %d\n", compress_level);
+
get_unique_name();
do_write_test(file_size, min_buf_size, max_buf_size);
cleanup();
return EXIT_SUCCESS;
}
-#else /* H5_HAVE_ZLIB_H */
+#else
/*
* Function: main