Introduce ZSTD_getFrameProgression()

Produces 3 statistics for ongoing frame compression :
- ingested
- consumed (effectively compressed)
- produced

Ingested can be larger than consumed due to buffering effect.

For the time being, this patch mostly fixes the % ratio issue,
since it computes consumed / produced,
instead of ingested / produced.

That being said, update is not "smooth",
because on a slow enough setting,
fileio spends most of its time waiting for a worker to complete its job.

This could be improved thanks to more granular flushing
i.e. start flushing before ongoing job is fully completed.
This commit is contained in:
Yann Collet
2018-01-17 16:39:02 -08:00
parent 592ce5a042
commit 394eec697b
7 changed files with 208 additions and 169 deletions
+1
View File
@@ -172,6 +172,7 @@ struct ZSTD_CCtx_s {
size_t blockSize;
U64 pledgedSrcSizePlusOne; /* this way, 0 (default) == unknown */
U64 consumedSrcSize;
U64 producedCSize;
XXH64_state_t xxhState;
ZSTD_customMem customMem;
size_t staticSize;