TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

performance problem: --declaration and --outFile very slow

Open nemenos opened this issue 10 years ago • 6 comments

TypeScript Version: 1.8.2

I'm using --outFile, --module system and --declaration. It's very very slow (almost 15-20 seconds).

Diagnostics: Files: 129 Lines: 49208 Nodes: 202105 Identifiers: 74553 Symbols: 3657523 Types: 16087 Memory used: 179859K I/O read: 0.04s I/O write: 0.07s Parse time: 0.72s Bind time: 0.40s Check time: 1.89s Emit time: 0.57s Total time: 3.58s

total time shown in diagnostics is not real, it takes almost 15-20 seconds to complete If I remove declaration generation times are close to 3.5s we find on diagnostics. If I don't use --outFile, performance gets good again

I don't know if it's a good approach, but I'm trying to separate a big project into a smaller one, that's why I'm using this for development purposes

tsconfig.ts is:
{
    "compilerOptions": {
        "module": "system",
        "jsx": "react",
        "target": "es5",
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "noImplicitAny": true,
        "rootDir": ".",
        "noEmitOnError": true,
        "allowSyntheticDefaultImports": true,
        "sourceMap": true,
        "outFile": "dist/albatross.js",
        "declaration": true,
        "noFallthroughCasesInSwitch": true,
        "noImplicitReturns": true,
        "forceConsistentCasingInFileNames": true        
    },
    "exclude": [
        "dist"
    ]
}

nemenos avatar Feb 24 '16 17:02 nemenos

what OS are your running on? what version of node are you using?

mhegazy avatar Feb 24 '16 18:02 mhegazy

out of curiosity does time got improved if you omit noEmitOnError option?

vladima avatar Feb 24 '16 18:02 vladima

what OS are your running on? what version of node are you using? I'm on Windows 10, node v5.7.0

out of curiosity does time got improved if you omit noEmitOnError option? Yes, just tried that, problem resolved w/out noEmitOnError. Any clue?

nemenos avatar Feb 24 '16 20:02 nemenos

thanks for reporting this issue! fix is checked in and should be available in today's nightly bits: typescript@next on npm.

vladima avatar Feb 24 '16 23:02 vladima

Also on nuget: https://github.com/Microsoft/TypeScript/wiki/Nightly-drops#using-nuget-with-msbuild

mhegazy avatar Feb 24 '16 23:02 mhegazy

StackOverflow issue for reference: http://stackoverflow.com/questions/35608986/medium-large-typescript-projects-build-performance-problems

DanielRosenwasser avatar Feb 25 '16 09:02 DanielRosenwasser