When verbose, display uncompressed bytes/token ratio

This commit is contained in:
emmanuel-marty 2019-04-07 15:10:17 +02:00
parent be54a4f889
commit 9c35d5115b

View File

@ -249,8 +249,10 @@ static int lzsa_compress(const char *pszInFilename, const char *pszOutFilename,
double fDelta = ((double)(nEndTime - nStartTime)) / 1000000.0; double fDelta = ((double)(nEndTime - nStartTime)) / 1000000.0;
double fSpeed = ((double)nOriginalSize / 1048576.0) / fDelta; 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", int nCommands = lzsa_compressor_get_command_count(&compressor);
pszInFilename, fDelta, fSpeed, lzsa_compressor_get_command_count(&compressor), nOriginalSize, nCompressedSize, (double)(nCompressedSize * 100.0 / nOriginalSize)); 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); lzsa_compressor_destroy(&compressor);