zstd is verbose by default

Created on 13 May 2018  ·  3Comments  ·  Source: facebook/zstd

$ zstd --version

* zstd command line interface 64-bits v1.3.3, by Yann Collet *

No verbose output should be displayed unless the "--verbose" option is given.

I know the man page says:

When compressing a single file, zstd displays progress notifications and result summary by default. Use -q to turn them off.

Other compression programs (e.g. gzip, bzip2, xz, lzip) are not verbose by default.

Most helpful comment

It's a deliberate choice of zstd interface : put human interaction first.

When a user invests its time manually typing a command to compress a file or a stream, there are a bunch of related expectations :

  • User will want to know if some progression is actually happening, and also have a rough idea of how much waiting is needed before processing ends. A blinking cursor falls short of this objective : the program could actually be stuck in an infinite loop ! Waiting with no feedback is therefore a bit more "stressful".
  • User is assumed to be interested in the compression outcome that was manually requested, hence a quick summary is displayed at the end.

This is different from a program which puts "automated scripting first". In which case, compression operation is just one part of a larger pipeline, and all those feedback become useless, if not annoying. Hence it's better if they are not present.

In both cases there are solutions : programs like zstd which favor human interaction nonetheless allow command -q to silence feedback for scripts. Programs which favor script integration generally provide a way for human users to state their will to receive some feedback, through -v command typically (note that, in many cases, progression feedback is not part of contract, only end summary).
So the differences end up being rather small.

At the end of the day, I believe the choice made for zstd is a bit better : it provides a more "inviting" first experience, featuring more feedback signals. And first experience is very important before a user starts to consider "advanced" scenarios, such as embedding compression into a larger processing stage.
As for script integration, in most cases, compressors are invoked through some variable. In which case, setting something like compress = zstd -q is not much more different than setting compress = zstd.

All 3 comments

It's a deliberate choice of zstd interface : put human interaction first.

When a user invests its time manually typing a command to compress a file or a stream, there are a bunch of related expectations :

  • User will want to know if some progression is actually happening, and also have a rough idea of how much waiting is needed before processing ends. A blinking cursor falls short of this objective : the program could actually be stuck in an infinite loop ! Waiting with no feedback is therefore a bit more "stressful".
  • User is assumed to be interested in the compression outcome that was manually requested, hence a quick summary is displayed at the end.

This is different from a program which puts "automated scripting first". In which case, compression operation is just one part of a larger pipeline, and all those feedback become useless, if not annoying. Hence it's better if they are not present.

In both cases there are solutions : programs like zstd which favor human interaction nonetheless allow command -q to silence feedback for scripts. Programs which favor script integration generally provide a way for human users to state their will to receive some feedback, through -v command typically (note that, in many cases, progression feedback is not part of contract, only end summary).
So the differences end up being rather small.

At the end of the day, I believe the choice made for zstd is a bit better : it provides a more "inviting" first experience, featuring more feedback signals. And first experience is very important before a user starts to consider "advanced" scenarios, such as embedding compression into a larger processing stage.
As for script integration, in most cases, compressors are invoked through some variable. In which case, setting something like compress = zstd -q is not much more different than setting compress = zstd.

Hi,
I'm using zstd in a script. I'd like to see some feedback like compression percentage in the log files, but the control characters are not well accepted (e.g. ^M, progress string repetitions).
Which zstd options should I use? I already tried "-q -v" but with no results.

This capability does not exist yet.
There is a similar request at #1371 .

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rgdoliveira picture rgdoliveira  ·  3Comments

TheSil picture TheSil  ·  3Comments

vade picture vade  ·  3Comments

terrelln picture terrelln  ·  3Comments

robert3005 picture robert3005  ·  4Comments