Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace
gzip
with zstd
for speed + size benefits
Replace `gzip` with `zstd` for both speed + size benefits. I added `zstd` to the base image rather than the python-specific image because: 1. it's only 1,695 KB 2. We'll likely use it in other places down the road, such as unpacking deps for jobs 3. The Python image would have required additional steps like `apt-get update` This results in faster compression + space savings: ```shell root@ca684869d4af:/usr/local/.pyenv/versions# time tar -acf 3.11.5.tar.gz 3.11.5 real 0m5.564s user 0m5.458s sys 0m0.626s root@ca684869d4af:/usr/local/.pyenv/versions# time tar -acf 3.11.5.tar.zst 3.11.5 real 0m0.850s user 0m1.003s sys 0m0.354s root@ca684869d4af:/usr/local/.pyenv/versions# ls -lah -rw-r--r-- 1 root root 32M Sep 1 17:19 3.11.5.tar.gz -rw-r--r-- 1 root root 30M Sep 1 17:20 3.11.5.tar.zst ``` As well as faster decompression too: ```shell root@ca684869d4af:/usr/local/.pyenv/versions# ls -lah -rw-r--r-- 1 root root 32M Sep 1 17:38 3.11.5.tar.gz -rw-r--r-- 1 root root 30M Sep 1 17:36 3.11.5.tar.zst root@ca684869d4af:/usr/local/.pyenv/versions# time tar -axf $PYENV_ROOT/versions/3.11.5.tar.gz -C $PYENV_ROOT/versions real 0m1.113s user 0m0.986s sys 0m0.811s root@ca684869d4af:/usr/local/.pyenv/versions# rm -rf 3.11.5 root@ca684869d4af:/usr/local/.pyenv/versions# time tar -axf $PYENV_ROOT/versions/3.11.5.tar.zst -C $PYENV_ROOT/versions real 0m0.774s user 0m0.501s sys 0m0.695s ``` The `-a` flag to `tar` tells it to autoselect the compression format based on the file extension, so it's flipping between `gzip` and `zstd`.
- Loading branch information