From 9c35d5115b73e8a8521cb3dba6c6e4f6a220044f Mon Sep 17 00:00:00 2001 From: emmanuel-marty Date: Sun, 7 Apr 2019 15:10:17 +0200 Subject: [PATCH] When verbose, display uncompressed bytes/token ratio --- src/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index b844caf..6d82866 100755 --- a/src/main.c +++ b/src/main.c @@ -249,8 +249,10 @@ static int lzsa_compress(const char *pszInFilename, const char *pszOutFilename, double fDelta = ((double)(nEndTime - nStartTime)) / 1000000.0; double fSpeed = ((double)nOriginalSize / 1048576.0) / fDelta; - fprintf(stdout, "\rCompressed '%s' in %g seconds, %.02g Mb/s, %d tokens, %lld into %lld bytes ==> %g %%\n", - pszInFilename, fDelta, fSpeed, lzsa_compressor_get_command_count(&compressor), nOriginalSize, nCompressedSize, (double)(nCompressedSize * 100.0 / nOriginalSize)); + int nCommands = lzsa_compressor_get_command_count(&compressor); + fprintf(stdout, "\rCompressed '%s' in %g seconds, %.02g Mb/s, %d tokens (%lld bytes/token), %lld into %lld bytes ==> %g %%\n", + pszInFilename, fDelta, fSpeed, nCommands, nOriginalSize / ((long long)nCommands), + nOriginalSize, nCompressedSize, (double)(nCompressedSize * 100.0 / nOriginalSize)); } lzsa_compressor_destroy(&compressor);