s5cmd icon indicating copy to clipboard operation
s5cmd copied to clipboard

[Bug] Unnecessary `headObject` calls on `cp` command when progress bar is disabled

Open ItielOlenick opened this issue 11 months ago • 0 comments

Description:
When using the cp command to copy or download objects, the progress bar logic is making an unnecessary headObject call (via client.stat) to retrieve the size of the object, even when the progress bar is explicitly disabled. This results in:

  1. Increased Latency: Each unnecessary headObject call adds overhead, especially when downloading or copying a large number of small files.
  2. Unnecessary Costs: Since headObject calls are billed requests, this behavior incurs additional costs for users, particularly in use cases involving bulk operations.

Expected Behavior:
If the progress bar is disabled (default), the cp command should skip the headObject call entirely, as the object size is not needed for progress tracking.

Steps to Reproduce:

  1. Run a cp command with the progress bar disabled (default).
  2. Observe network traffic logs (--log=trace) to confirm that a headObject call is still being made.

Impact:

  • Performance: Slower operations due to unnecessary API calls.
  • Cost: Increased billing for headObject requests, especially in bulk operations.

ItielOlenick avatar Feb 12 '25 08:02 ItielOlenick