Created
November 21, 2024 09:49
-
-
Save CezaryDanielNowak/b6a1c811a32031e58dda6614059453d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd sdk-js/dist/ | |
find . -name "*.br" -type f -delete | |
find . -name "*.gz" -type f -delete | |
for i in {0..11} | |
do | |
echo "[ BROTLI ${i} ]" | |
time { | |
find -name '*.html' -exec brotli -q $i -f -n -o "{}.br" "{}" \; | |
find -name '*.js' -exec brotli -q $i -f -n -o "{}.br" "{}" \; | |
find -name '*.css' -exec brotli -q $i -f -n -o "{}.br" "{}" \; | |
find -name '*.wasm' -exec brotli -q $i -f -n -o "{}.br" "{}" \; | |
find -name '*.json' -exec brotli -q $i -f -n -o "{}.br" "{}" \; | |
} | |
find . -name '*.br' -exec stat -c %n,%s {} \; | awk -F, '{sum+=$2}END{print sum}' | |
find . -name "*.br" -type f -delete | |
done | |
# for i in {0..9} | |
# do | |
# echo "[ GZIP ${i} ]" | |
# time { | |
# # find -name '*.html' -exec gzip -$i -k "{}" \; | |
# # find -name '*.js' -exec gzip -$i -k "{}" \; | |
# # find -name '*.css' -exec gzip -$i -k "{}" \; | |
# # find -name '*.wasm' -exec gzip -$i -k "{}" \; | |
# find -name '*.json' -exec gzip "{}" -kf"$i" \; | |
# } | |
# find . -name '*.gz' -exec stat -c %n,%s {} \; | awk -F, '{sum+=$2}END{print sum}' | |
# find . -name "*.gz" -type f -delete | |
# done |
Author
CezaryDanielNowak
commented
Nov 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment