The execution time of a simple ts-node --version
needs a long time
I have a fresh virtual maschine (xen, 20GB RAM, lots of free space) with ubuntu 18.04 server. node/npm installed via package manager. Unfortunately the execution of a simple ts-node --version needs really long time to finish:
time ./node_modules/.bin/ts-node --version
ts-node v7.0.1
node v8.10.0
typescript v3.6.4
cache "/tmp/ts-node-94a6b447580330f9f2b609422537b04239ff3a39df9137e32efd559f1a2935cb/9d1b7d973ebcaeec54cd97f2de9eb4549430f03609c30b1504d897556bb2d5af"
real 2m44,511s
user 0m32,442s
sys 0m19,245s
Using a local virtual maschine (ubuntu 18.04 but virtual box and only 6GB RAM) the same request needs under a second:
time ./node_modules/.bin/ts-node --version
ts-node v7.0.1
node v8.10.0
typescript v3.6.4
cache "/tmp/ts-node-1da900a950c0ee3f0f80ae0bb561a80b80e89de692835d79984eb12d0a2f2a44/ca51062b04b699dcb91ec472983c8d598ee9fb43791553c229cba71256858f5a"
real 0m0,918s
user 0m0,840s
sys 0m0,083s
./node_modules/.bin/ts-node --help
is really fast.
If I look in ./node_modules/.bin/ts-node
(link to ../ts-node/dist/bin.js
) the following prodecure is the problem:
var service = index_1.register({
files: argv.files,
pretty: argv.pretty,
typeCheck: argv.typeCheck,
transpileOnly: argv.transpileOnly,
cache: argv.cache,
cacheDirectory: argv.cacheDirectory,
ignore: argv.ignore,
project: argv.project,
skipIgnore: argv.skipIgnore,
skipProject: argv.skipProject,
compiler: argv.compiler,
ignoreDiagnostics: argv.ignoreDiagnostics,
compilerOptions: index_1.parse(argv.compilerOptions) || index_1.DEFAULTS.com
pilerOptions,
readFile: isEval ? readFileEval : undefined,
fileExists: isEval ? fileExistsEval : undefined
});
I use following tsconfig.json:
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"esModuleInterop": true
},
"exclude": ["node_modules"]
}
fresh npm install
Versions:
node --version
v8.10.0
npm --version
3.5.2
Maybe someone has an idea...