Improve startup time by adding fast-boot

Change-type: minor
Signed-off-by: Shaun Mulligan <shaun@balena.io>
This commit is contained in:
Shaun Mulligan 2019-01-11 16:34:29 +01:00 committed by Pagan Gazzard
parent 31f4af721d
commit 2ba53649bd
4 changed files with 14 additions and 2 deletions

3
.gitignore vendored
View File

@ -39,3 +39,6 @@ balenarc.yml
build/
build-bin/
build-zip/
# Ignore fast-boot cache file
/bin/.fast-boot.json

View File

@ -4,4 +4,8 @@
// operations otherwise, if the pool runs out.
process.env.UV_THREADPOOL_SIZE = '64';
// Use fast-boot to cache require lookups, speeding up startup
require('fast-boot2').start({
cacheFile: __dirname + '/.fast-boot.json'
})
require('../build/app');

View File

@ -9,6 +9,10 @@
// operations otherwise, if the pool runs out.
process.env.UV_THREADPOOL_SIZE = '64';
// Use fast-boot to cache require lookups, speeding up startup
require('fast-boot2').start({
cacheFile: '.fast-boot.json'
})
process.env['TS_NODE_PROJECT'] = require('path').dirname(__dirname);
require('coffeescript/register');
require('ts-node/register');

View File

@ -109,7 +109,7 @@
"balena-preload": "^8.0.4",
"balena-sdk": "^11.2.0",
"balena-settings-client": "^4.0.0",
"balena-sync": "^10.0.0",
"balena-sync": "^10.0.2",
"bash": "0.0.1",
"bluebird": "^3.3.3",
"body-parser": "^1.14.1",
@ -130,6 +130,7 @@
"etcher-sdk": "^0.2.0",
"event-stream": "3.3.4",
"express": "^4.13.3",
"fast-boot2": "^1.0.9",
"global-tunnel-ng": "^2.1.1",
"hasbin": "^1.2.3",
"humanize": "0.0.9",
@ -153,7 +154,7 @@
"reconfix": "^0.1.0",
"request": "^2.81.0",
"resin-bundle-resolve": "^0.6.0",
"resin-cli-form": "^2.0.0",
"resin-cli-form": "^2.0.1",
"resin-cli-visuals": "^1.4.0",
"resin-compose-parse": "^2.0.0",
"resin-doodles": "0.0.1",