microsoft / TypeScript-Sublime-Plugin

IO wrapper around TypeScript language services, allowing for easy consumption by editor plugins
Apache License 2.0
1.72k stars 235 forks source link

High CPU usage caused with Sublime Text 3 #654

Open zvuc opened 6 years ago

zvuc commented 6 years ago

(macOS High Sierra 10.13.4)

I'm noticing very high CPU usage on idle for ST3 when the TypeScript package is installed. 25% of my CPU (3.5GHz i5, iMac 5K Late 2014) is consumed just by running ST3 and opening up a ts file, when I remove the package, quit and run ST3 the idle sits under 4% as it should.

I thought it may be Sublime's issue as build 3154 included a fix for improving idle CPU usage, so I tried installing the latest dev build (3160) instead of my existing 3143 (latest stable), but idle CPU usage did not drop when using the TypeScript package.

Just in case it may matter: node version that I'm using is v9.10.1. (previously I was on v9.8.0, same issue)

DanielRosenwasser commented 6 years ago

Does this happen consistently on any project?

zvuc commented 6 years ago

It happens in our own project (private), but I tried cloning the vscode (https://github.com/Microsoft/vscode) repository, opened the directory in ST3 and opened random ts files: main.ts and paths.ts. I see CPU spike immediately, and even after about 30 seconds, node process takes up almost 100% CPU usage (25% of total if counting all 4 cores) on idle. (Same behavior when using in our own project)

screen shot 2018-04-09 at 5 16 52 pm

Interestingly, node process is not killed even when completely quitting Sublime Text 3. It stays visible in activity monitor, and another instance of node is fired up again when starting ST3 and opening up a TypeScript file.

screen shot 2018-04-09 at 5 20 06 pm

Same file without TypeScript plugin installed. (Syntax highlighting is done by a different package, TypeScript Syntax) CPU usage is minimal.

saade commented 6 years ago

+1 Same here

I was getting random freezes on copy, paste, save file... I uninstalled, the problem was solved Installed again, same problem

Currently i'm not using anymore until this issue was fixed

caseycole589 commented 5 years ago

I am having this same problem windows 10

cmthakur commented 5 years ago

Same issue here.

Sirka7 commented 4 years ago

Same here. Love the editor and plugin, but this makes it unusable.

cesc1989 commented 4 years ago

Just today, I experienced this same issue after installing this plugin in Sublime Text 3 build 3211.

Have TypeScript Sintax plugin installed but this one doesn't cause any CPU high usage.

MBP 13": Mac OS Mojave 10.14.6