Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
examples: fix csv generation in submodules example.
Browse files Browse the repository at this point in the history
  • Loading branch information
nunofmn committed Jun 26, 2017
1 parent 9581ce0 commit d1dedc6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
56 changes: 28 additions & 28 deletions examples/sub-module/bundles-size-KBs.csv
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name - bundled - minified
IPFS - 1685.41 - 661.64
add - 968.11 - 344.13
bitswap - 684.80 - 232.13
block - 724.77 - 250.23
bootstrap - 685.64 - 232.39
cat - 725.05 - 250.33
commands - 683.89 - 231.76
config - 686.87 - 233.10
dht - 688.51 - 233.41
diag - 684.97 - 232.18
files - 1120.38 - 404.30
get - 907.74 - 318.35
id - 684.31 - 231.95
key - 684.59 - 232.03
log - 685.40 - 232.38
ls - 684.00 - 231.80
mount - 684.18 - 231.86
name - 684.63 - 232.06
object - 923.66 - 340.57
pin - 685.51 - 232.39
ping - 684.59 - 231.90
pubsub - 740.40 - 249.54
refs - 684.39 - 231.94
repo - 684.56 - 232.02
swarm - 1324.18 - 527.03
update - 684.45 - 231.96
version - 684.21 - 231.88
name - bundled KBs - minified
IPFS, 1685.41, 661.64
add, 968.11, 344.13
bitswap, 684.80, 232.13
block, 724.77, 250.23
bootstrap, 685.64, 232.39
cat, 725.05, 250.33
commands, 683.89, 231.76
config, 686.87, 233.10
dht, 688.51, 233.41
diag, 684.97, 232.18
files, 1120.38, 404.30
get, 907.74, 318.35
id, 684.31, 231.95
key, 684.59, 232.03
log, 685.40, 232.38
ls, 684.00, 231.80
mount, 684.18, 231.86
name, 684.63, 232.06
object, 923.66, 340.57
pin, 685.51, 232.39
ping, 684.59, 231.90
pubsub, 740.40, 249.54
refs, 684.39, 231.94
repo, 684.56, 232.02
swarm, 1324.18, 527.03
update, 684.45, 231.96
version, 684.21, 231.88
12 changes: 6 additions & 6 deletions examples/sub-module/test-modules-size.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ echo "name - bundled - minified"
webpack --display none --config webpack.config.js complete-module.js complete-bundle.js
babili complete-bundle.js -o complete-bundle-minified.js

ipfsBundleSize=($(wc -c < complete-bundle.js | awk '{b=$1/1024; printf "%.2f\n", b}'))
ipfsMinSize=($(wc -c < complete-bundle-minified.js | awk '{b=$1/1024; printf "%.2f\n", b}'))
ipfsBundleSize=($(wc -c < complete-bundle.js | awk '{b=$1/1024; printf "%.2f\n", b}' | sed 's/,/./g'))
ipfsMinSize=($(wc -c < complete-bundle-minified.js | awk '{b=$1/1024; printf "%.2f\n", b}' | sed 's/,/./g'))

echo IPFS - $ipfsBundleSize - $ipfsMinSize
echo IPFS, $ipfsBundleSize, $ipfsMinSize

for module in "${modules[@]}"
do
moduledir="modules/$module"
webpack --display none --config webpack.config.js $moduledir/$module.js $moduledir/bundle.js
babili $moduledir/bundle.js -o $moduledir/bundle-minified.js

bundlesize=($(wc -c < $moduledir/bundle.js | awk '{b=$1/1024; printf "%.2f\n", b}'))
minsize=($(wc -c < $moduledir/bundle-minified.js | awk '{b=$1/1024; printf "%.2f\n", b}'))
echo $module - $bundlesize - $minsize
bundlesize=($(wc -c < $moduledir/bundle.js | awk '{b=$1/1024; printf "%.2f\n", b}' | sed 's/,/./g'))
minsize=($(wc -c < $moduledir/bundle-minified.js | awk '{b=$1/1024; printf "%.2f\n", b}' | sed 's/,/./g'))
echo $module, $bundlesize, $minsize
done

0 comments on commit d1dedc6

Please sign in to comment.