Skip to content

High CPU usage with --watch when idling on MacOS #1317

Open
@pdobrev

Description

@pdobrev

When I'm running $ tsgo --watch I am seeing consistently high CPU usage when idling on a Mac -- around 120%-170% as reported by Activity Monitor. No files are being changed and nothing is being worked on.

$ tsgo --watch

build starting at 2025-06-30 14:25:39.948731 +0300 EEST m=+0.611922626
build finished in 1.668952292s
Image

Unsure whether this is expected due to the experimental implementation of watch mode for now, but thought I would report, as I am not seeing the same usage with npx tsc -w, which stays flat at 0 when there is no activity.

For context:

tsconfig.json:

{
    "compilerOptions": {
        "allowJs": false,
        "lib": ["es2019", "dom"],
        "moduleResolution": "node",
        "target": "es2019",
        "module": "commonjs",
        "noImplicitReturns": true,
        "noFallthroughCasesInSwitch": true,
        "noUnusedLocals": true,
        "pretty": true,
        "noImplicitAny": true,
        "noImplicitThis": false,
        "alwaysStrict": true,
        "strictNullChecks": true,
        "strictFunctionTypes": true,
        "strictPropertyInitialization": false,
        "sourceMap": true,
        "outDir": "./dist",
        "skipLibCheck": true,
        "resolveJsonModule": true,
        "esModuleInterop": true,
        "declaration": true,
        "baseUrl": ".",
        "typeRoots": ["./node_modules/@types", "./@types"],
        "forceConsistentCasingInFileNames": true,
        "paths": {
            "src": ["./src"]
        }
    },
    "include": ["src/**/*.ts", "src/sites/**/*.json", "@types/**/*"],
    "exclude": ["node_modules", "dist", ".git"]
}

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: CLIRelated to the tsc CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions