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

Plugin slows down Sublime Text #716

Open Serega124 opened 5 years ago

Serega124 commented 5 years ago

Typescript plugin extremely slows down text typing and selection performance on large files like tsserver.js. Slowing down appears even after renaming that file to .txt and opening as Plain Text. This is very annoying when you need to view large logs or csv files.

This behavior is reproducible in clean portable installation of Sublime Text with only TypeScript plugin installed even without opened project and tsconfig.json.

Disabling plugin via Package Control makes Sublime smooth again. Can using *_async api help here? Or is there any setting to disable processing non-js/ts files?

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-4430 CPU @ 3.00GHz (4 x 3000)| |Memory (System)|15.93GB (9.38GB free)| |System|Windows 10.0.17763.475 (x64)| |Sublime|v3.2.1 build 3207 x64 stable channel| |Typescript plugin|v3.4.1|
Plugin Event Profile ``` This list shows how much time each plugin has taken to respond to each event: on_activated: Default.pane: 0.001s total, mean: 0.000s, max: 0.001s TypeScript.typescript.listeners.listeners: 1.334s total, mean: 0.056s, max: 0.265s on_close: Default.pane: 0.000s total, mean: 0.000s, max: 0.000s TypeScript.typescript.listeners.listeners: 0.164s total, mean: 0.055s, max: 0.163s on_deactivated: Default.history_list: 0.011s total, mean: 0.000s, max: 0.002s on_hover: Default.symbol: 0.004s total, mean: 0.000s, max: 0.001s TypeScript.typescript.listeners.listeners: 3.556s total, mean: 0.155s, max: 0.691s on_load: Default.detect_indentation: 0.003s total, mean: 0.002s, max: 0.003s TypeScript.typescript.listeners.listeners: 0.000s total, mean: 0.000s, max: 0.000s Default.exec: 0.003s total, mean: 0.001s, max: 0.002s on_modified: TypeScript.typescript.listeners.listeners: 36.134s total, mean: 0.317s, max: 1.174s on_pre_close: Default.history_list: 0.000s total, mean: 0.000s, max: 0.000s on_selection_modified: TypeScript.typescript.listeners.listeners: 88.955s total, mean: 0.217s, max: 1.569s ```
olofssonanton commented 5 years ago

I am experiencing the same issue and am also looking for an ability to disable processing of js files.

olofssonanton commented 5 years ago

I found out how to disable processing of js files. Add this line to this package's Preferences.sublime-settings: "enable_language_service_for_javascript": false

iahu commented 3 years ago

On my case, run yarn install or yarn build command will trigger a hight cpu usage issue, every time.

I have to quit Sublime Text before run that commands