Merge pull request #296 from danvk/xlog
[dygraphs.git] / file-size-stats.sh
CommitLineData
3641418e
DV
1#!/bin/bash
2
3# Reports compressed file sizes for each JS file in dygraphs.
4
5# This list needs to be kept in sync w/ the one in dygraph-dev.js
6# and the one in jsTestDriver.conf.
7for file in \
8dygraph-layout.js \
9dygraph-canvas.js \
10dygraph.js \
11dygraph-utils.js \
12dygraph-gviz.js \
13dygraph-interaction-model.js \
3641418e 14dygraph-tickers.js \
3641418e 15dashed-canvas.js \
1beeb310 16dygraph-plugin-base.js \
3641418e
DV
17plugins/annotations.js \
18plugins/axes.js \
ec475f44 19plugins/range-selector.js \
3641418e
DV
20plugins/chart-labels.js \
21plugins/grid.js \
22plugins/legend.js \
1beeb310 23dygraph-plugin-install.js \
3641418e
DV
24; do
25 base_size=$(cat $file | wc -c)
26 cat $file \
27 | perl -ne 'print unless m,REMOVE_FOR_COMBINED,..m,/REMOVE_FOR_COMBINED,' \
28 > /tmp/dygraph.js
29 min_size=$(java -jar yuicompressor-2.4.2.jar /tmp/dygraph.js | gzip -c | wc -c)
30
31 echo "$min_size ($base_size) $file"
32done