-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-data.sh
executable file
·38 lines (30 loc) · 1.57 KB
/
create-data.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
echo "creating data. this may take some time."
rm -f flat.js
rm -rf data
rm -rf nested-testfile
echo "console.time('node')" >> flat.js
mkdir -p data
for i in {0..10000};
do
echo "require('./data/$i')" >> flat.js
mkdir data/$i
echo 'module.exports = "ente"' > data/$i/index.js
echo '{"main": "index.js"}' > data/$i/package.json
done
echo "console.timeEnd('node')" >> flat.js
DIR="data/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/"
mkdir -p $DIR
echo "console.time('node')" >> $DIR/nested.js
mkdir nested-testfile
echo 'module.exports = "ente"' > nested-testfile/index.js
echo '{"main": "index.js"}' > nested-testfile/package.json
echo "require('./../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../nested-testfile')" >> $DIR/nested.js
echo "console.timeEnd('node')" >> $DIR/nested.js
git clone https://github.com/npm/newww
cd newww && git reset --hard 3c6fd1ae706ac9fd6a48e97103d6867a02a3f8e6
npm install
node allPlugins.js install
echo "console.time('node')" | cat - server.js > /tmp/out && mv /tmp/out server.js
sed 's/log.info(.Hapi server started @ . + server.info.uri);/console.timeEnd("node");process.exit();/g' server.js > /tmp/out && mv /tmp/out server.js
echo "finished."