Dramatically decrease resources for file embedding.

This dramatically decreases the needed time and memory for building the
blob files. The memory numbers are measured via the
memory.max_usage_in_bytes value from cgroups.

* generating files.go:
OLD: 466MB   19s
NEW:  80MB    1s

* building files.go:
OLD: 1210MB  2.25s
NEW:    7MB  0.05s
pull/526/head
Julius Volz 10 years ago
parent 498e1b5154
commit 8cb2c802a0

@ -21,9 +21,9 @@ do
find . -type f \! -name \*.map \! -name bootstrap.js \! -name bootstrap-theme.css \! -name bootstrap.css | while read file
do
name=$(echo "${file}"|sed 's|\.\/||')
echo "\"$name\": {"
gzip -9 -c "${file}" | xxd -p |sed 's/\(..\)/0x\1, /g'
echo "},"
echo -n "\"$name\": []byte(\""
gzip -9 -c "${file}" | xxd -p | tr -d '\n' | sed 's/\(..\)/\\x\1/g'
echo "\"),"
echo
done
echo "},"

Loading…
Cancel
Save