`sam deploy` is slow to upload build artifacts to S3
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 1.2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
### Description:
When running `sam deploy` command, it seems to upload build artifacts to S3 at a fixed rate of ~230 KB/s, while the upload speed of my internet connection is capped at 2 MB/s. Although the stack region (US-EAST-1) is geographically quite far from my physical location, normal S3 upload speed doesn't suffer as much compared to SAM. I'm working on a Golang project with several lambda functions and the upload takes a while to complete, delaying the process already slowed down by cfn.
Interestingly, when using `sam sync --watch` command, this slow upload only occurs when initially uploading the build artifacts. On subsequent changes to the code and resyncing, the upload speed is comparable to normal S3 upload speed.
Also, this is not a regression afaik. I've been facing this issue ever since I started working with sam (version 1.29). I thought this behavior was normal until I started using `sam sync --watch`.
### Steps to reproduce:
1. Run `sam deploy` for a Go project.
2. Observe upload speed using windows task manager or any internet speed monitoring software.
### Observed result:
Upload speed when uploading build artifacts:

Upload speed when directly uploading to S3 from browser:

Upload speed when running [Amazon S3 Transfer Acceleration Speed Comparison tool](https://s3-accelerate-speedtest.s3-accelerate.amazonaws.com/en/accelerate-speed-comparsion.html):

### Expected result:
Upload speed of build artifacts should be comparable to normal S3 upload speed.
### Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
1. OS: Windows 10
2. `sam --version`: 1.58.0
3. AWS region: US-EAST-1
Contributor guide
Assessment
This issue has not been assessed yet.