pypi-tools icon indicating copy to clipboard operation
pypi-tools copied to clipboard

Notes for optimising images

Open hugovk opened this issue 2 years ago • 1 comments

sequential

time for f in $(ls images/*.png); do optipng -o7 -zm1-9 $f; done

32m15s

parallel

https://www.freecodecamp.org/news/how-to-supercharge-your-bash-workflows-with-gnu-parallel-53aab0aea141/

brew install parallel optipng
time ls images/*.png | parallel optipng -o7 -zm1-9 {}

3m39s

monthly update steps

preconditions: set up pypinfo

python -m pip install -r requirements.txt
brew install parallel optipng

then:

cd ~/github/pypi-tools
git up
./get-data.sh
make -j 10
time ls images/*.png | parallel optipng -o7 -zm1-9 {}

git add data/*2022-08.json
git add images/
git commit -m "Add 2022-08 data"

or a bit easier (tested Feb 2023):

cd ~/github/pypi-tools
git up
make data
make -j 10
make compress

pre-commit run --all-files
git add README.md charts.md

git add data/*2024*
git add images/
git commit -m "Add 2024-01 data"

hugovk avatar Feb 26 '23 12:02 hugovk