I was giving the meteor 1.4.2.rc.0 build a spin in the hope that startup times would be substantially better... sadly, not as much as I would like. So I did a profiling run on the initial launch of meteor (on OSX 10.11.6 MacBook Pro 2015, 2.7 GHz Intel Core i5), Meteor 1.4.2.rc.0.
I used METEOR_PROFILE=100 TYPESCRIPT_LOG=4 meteor
on an app that had had no changes since the last run (a few minutes earlier).
The interesting thing is that the meteor profiling says:
prepareProjectForBuild takes 2.2s
Build App 94.4s of which compiler.compile takes 71s, but of that,
- JsImage#load runJavaScript packages/barbatus_typescript-compiler.js is 62.5s
Clearly, the bulk of the time is in the compiler, given there is other bundling to do etc.
The mystery for me is that there's no obvious explanation in the typescript profiling, it says:
compiler options: {"experimentalDecorators":true,"module":"commonjs","target":"es5","isolatedModules":false,"moduleResolution":"node","emitDecoratorMetadata":true,"removeComments":false,"noImplicitAny":false,"sourceMap":true,"noEmitHelpers":true,"jsx":"react","noResolve":false,"lib":["es5","dom"],"diagnostics":true,"noImplicitUseStrict":true}
exclude started web.browser (335 files)
tsBuild time: 223ms
tsEmitFiles time: 818ms
compilation time: 1044ms
exclude started os.osx.x86_64 (173 files)
tsBuild time: 71ms
tsEmitFiles time: 163ms
compilation time: 234ms
All of the other messages seem to suggest that compilation output is coming from the cache, and times are one or two milliseconds with a few spurious 9-10 ms. But nothing large.
So is there a way to narrow down why Meteor thinks the typescript compiler is taking so long, and if everything is coming from the cache - what is taking a minute?
I'm not criticising the compiler or anything like that, I'm just trying to establish if there is anything I can do to improve our build times.
Note that I checked the file lists, and there doesn't seem to be anything particularly out of the ordinary or duplicates in the the list (e.g. I'm definitely not pulling in node_modules).