Skip to content

Compress embedded binaries (site/out/bin) #2202

Closed
@mafredri

Description

@mafredri

I'm suggesting we start compressing the binaries in site/out/bin as a step in goreleaser. This can go two ways:

  1. We serve the raw gzip or zip archives in coder server
  2. We transparently decompress the files when serving them

Currently the coder binary is very big sitting at 287M. This can cause the coder binary to take a very long time to respond on first run (before ending up in the fs cache). Here's an example on my 2017 MBP:

wget https://github.com/coder/coder/releases/download/v0.6.4/coder_0.6.4_darwin_amd64.zip
unzip coder_0.6.4_darwin_amd64.zip
time ./coder --help
# ...
./coder  0.10s user 0.09s system 4% cpu 4.446 total

Simply running a gzip on these binaries brings the total binary size down from 287M to 128M and improves performance significantly.

time ./coder-gzipped --help
./coder-gzipped --help  0.10s user 0.02s system 7% cpu 1.665 total

There's small gains to be had by increasing compression level or using zstd, but not significant enough to warrant any added complexity vs just compressing with something.

Metadata

Metadata

Assignees

Labels

apiArea: HTTP APIcliArea: CLIsiteArea: frontend dashboard

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions