Skip to content

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

Description

@nemenos

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"
    ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueHigh Priority

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions