]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fix fileio progression status update
authorYann Collet <cyan@fb.com>
Wed, 17 Jan 2018 01:35:00 +0000 (17:35 -0800)
committerYann Collet <cyan@fb.com>
Wed, 17 Jan 2018 01:35:00 +0000 (17:35 -0800)
The compression % is no longer correct,
since it's no longer possible to make direct correlation
between nb bytes read and nb bytes written
due to large internal buffer inside CCtx
(exacerbated with --long).

The current "fix" is to no longer display the %.

A more complex solution will have to count exactly how much data has been consumed and compressed internally, within CCtx buffers.

programs/fileio.c

index 58b77a8132603655ce74ce36a5051d554b8146d8..326f0e673caa2ff40453c0b11fa948e9b7c3254f 100644 (file)
@@ -809,21 +809,11 @@ static int FIO_compressFilename_internal(cRess_t ress,
                 compressedfilesize += outBuff.pos;
             }
         }
-        if (g_nbThreads > 1) {
-            if (fileSize == UTIL_FILESIZE_UNKNOWN)
-                DISPLAYUPDATE(2, "\rRead : %u MB", (U32)(readsize>>20))
-            else
-                DISPLAYUPDATE(2, "\rRead : %u / %u MB",
-                                    (U32)(readsize>>20), (U32)(fileSize>>20));
+        if (fileSize == UTIL_FILESIZE_UNKNOWN) {
+            DISPLAYUPDATE(2, "\rRead : %u MB", (U32)(readsize>>20));
         } else {
-            if (fileSize == UTIL_FILESIZE_UNKNOWN)
-                DISPLAYUPDATE(2, "\rRead : %u MB ==> %.2f%%",
-                                (U32)(readsize>>20),
-                                (double)compressedfilesize/readsize*100)
-            else
-                DISPLAYUPDATE(2, "\rRead : %u / %u MB ==> %.2f%%",
-                                (U32)(readsize>>20), (U32)(fileSize>>20),
-                                (double)compressedfilesize/readsize*100);
+            DISPLAYUPDATE(2, "\rRead : %u / %u MB",
+                                (U32)(readsize>>20), (U32)(fileSize>>20));
         }
     } while (directive != ZSTD_e_end);