Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slowdown on code assist with eslint enabled #215

Closed
benduran opened this issue Mar 14, 2017 · 28 comments
Closed

Slowdown on code assist with eslint enabled #215

benduran opened this issue Mar 14, 2017 · 28 comments
Labels
info-needed Issue requires more information from poster
Milestone

Comments

@benduran
Copy link

Just recently, I've been experiencing some issues with medium-sized javascript files with Redux.js action creation and dispatching-type code. I've tried installing the nightly build version of VSCode to see if it may have been something related to the latest stable version of VSCode. I've disabled a number of extensions, as well as the github integration. These had a marginal impact on performance. Disabling ESlint for my workspace, however, seemed to resolve the performance issue.

@dbaeumer
Copy link
Member

@benduran are you able to share your project. ESLint runs in a complete separate process than the JS code assist. I would like to understand why/how ESLint affects the JS code assist. Do you have high CPU load ?

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Mar 14, 2017
@benduran
Copy link
Author

@dbaeumer I may be able to share the specific file in question, but not the whole project, as it is a work-related project and contains sensitive information and features we cannot share with the public at the moment. I will try running a CPU profiler on VSCode while running my project and report back later this afternoon / early evening.

@mwadden
Copy link

mwadden commented Mar 16, 2017

I'm experiencing the same issue. I enabled the ESLint extension (dbaeumer.vscode-eslint) a few weeks ago and set {"eslint.autoFixOnSave": true}. Ever since, I quite frequently run into significant lag with code assist and often with vscode as a whole.

The lag becomes so noticeable that characters appear a solid second or two after I type them. After a while of increasing lag, the autoFixOnSave stops working altogether (although it doesn't throw any errors, it just stops fixing issues on save). ESLint will still detect and report on issues it finds though. When ESLint finally gives up it often clears up the lag along with it, but not always. Restarting vscode is the only way to clear it up. (EDIT: I just tried running Fix all auto-fixable problems from the command palette and that seemed to wake it up and autoFixOnSave started working again.)

The output window from ESLint only shows the following. I'll turn on verbose messages to see if anything stands out over the next few days.

[Info  - 1:29:15 PM] ESLint server is running.
[Info  - 1:29:28 PM] ESLint library loaded from: /Users/mark/repos/scout-client/node_modules/eslint/lib/api.js

So far this issue hasn't been restricted to one particular project for me either. I've noticed it while working on React, Ember and Node apps of various sizes.

Happy to help further if you need other specific details.

@benduran
Copy link
Author

@mwadden Thanks for chiming. I've been so busy at work that I haven't had time to run my CPU profile. I found that by switching to this: "eslint.run": "onSave" corrects my issue. It is really only noticeable when "eslint.run": "onType" is set (which it is by default)

@dbaeumer
Copy link
Member

@benduran I have an idea what could cause this since it becomes more responsice for onSave. Will look into this beginning of April.

@dbaeumer dbaeumer added this to the April 2017 milestone Mar 24, 2017
@benduran
Copy link
Author

@dbaeumer Thanks for checking into this. I'm glad I have a temporary work around for this issue, but I look forward to hearing more about a possible fix 👍

@dbaeumer
Copy link
Member

dbaeumer commented Apr 4, 2017

@dlong500 @benduran I worked on a new version of the ESLint extension that uses a more sophisticated validation queue. It will allow for even tweak the timeouts if necessary.

Since the change is bigger and it might not even fix the problems you are seeing I would like to ask you to beta test the version. To do so following these steps:

  • download vscode-eslint-1.2.9.zip
  • rename it to .vsix
  • install it using the code / code-insider command from a terminal. For example code --install-extension vscode-eslint-1.2.9.vsix
  • use it and let me know if it improves the behavior.

IMPORTANT: since you installed the extension using an explicit command the extension will not be auto updated from the store anymore. When I push 1.2.9 (which I will let you know in this issue) then you need to uninstall the ESLint extension and reinstall from the store. Sorry for this inconvenience.

@dlong500
Copy link

dlong500 commented Apr 4, 2017

Thanks. I'll test it out over the next few days and let you know how it goes.

@benduran
Copy link
Author

benduran commented Apr 6, 2017 via email

@benduran
Copy link
Author

benduran commented Apr 7, 2017

@dbaeumer I've been using the eslint build you prepped. I can confirm that it no longer affects intellisense while coding. Code assist is snappy like it was previously. However, some of my files do cause noticeable performance issues with the linting messages I receive in the eslint console in VS Code. The linter does eventually catch up, however, it is a bit sluggish. There are two files in question that cause this slowdown, but they're relatively small (one is less than 700 lines, the other is less than 300 lines).

@Jessidhia
Copy link

I've been having a similar issue with eslint in vs code -- sometimes it takes a very long time to catch up with linting a file that is being edited. Right now I am working on refactoring a ~2000 line file, so it is particularly noticeable, but it used to not be a problem 😕

The messages trace looks somewhat like this:

[Trace - 5:28:31 PM] Received notification 'eslint/status'.
[Trace - 5:28:31 PM] Received response 'textDocument/codeAction - (74)' in 13113ms.
[Trace - 5:28:32 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 5:28:32 PM] Received notification 'eslint/status'.
[Trace - 5:28:33 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 5:28:33 PM] Received notification 'eslint/status'.
[Trace - 5:28:33 PM] Received response 'textDocument/codeAction - (75)' in 15462ms.
[Trace - 5:28:33 PM] Received response 'textDocument/codeAction - (76)' in 15386ms.
[Trace - 5:28:34 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 5:28:34 PM] Received notification 'eslint/status'.
[Trace - 5:28:35 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 5:28:35 PM] Received notification 'eslint/status'.
[Trace - 5:28:35 PM] Received response 'textDocument/codeAction - (77)' in 17411ms.
[Trace - 5:28:35 PM] Received response 'textDocument/codeAction - (78)' in 17221ms.
[Trace - 5:28:36 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 5:28:36 PM] Received notification 'eslint/status'.
[Trace - 5:28:37 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 5:28:37 PM] Received notification 'eslint/status'.
[Trace - 5:28:37 PM] Received response 'textDocument/codeAction - (79)' in 19010ms.
[Trace - 5:28:37 PM] Received response 'textDocument/codeAction - (80)' in 18993ms.
[Trace - 5:28:38 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 5:28:38 PM] Received notification 'eslint/status'.
[Trace - 5:28:38 PM] Received response 'textDocument/codeAction - (81)' in 19838ms.
[Trace - 5:28:38 PM] Received response 'textDocument/codeAction - (82)' in 19675ms.
[Trace - 5:28:39 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 5:28:39 PM] Received notification 'eslint/status'.
[Trace - 5:28:40 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 5:28:40 PM] Received notification 'eslint/status'.
[Trace - 5:28:40 PM] Received response 'textDocument/codeAction - (83)' in 20812ms.
[Trace - 5:28:40 PM] Received response 'textDocument/codeAction - (84)' in 20693ms.

Often, when it starts lagging behind, the delays just keep getting larger and larger (while at 100% CPU) until I stop editing, at which point after several seconds the delays start getting shorter until it is done.

I have tried the build linked by @dbaeumer but the performance problem did not change.

@dbaeumer
Copy link
Member

dbaeumer commented Apr 10, 2017

@Kovensky thanks a lot for the trace. Would you be able to include the whole trace. To really understand what is going on I need to see the change notifications send from the client as well. They show up as Sending notification ... in the trace.

@benduran could you produce such a trace as well. To do so enable the setting "eslint.trace.server": "messages"

One thing that the trace shows is that there are two many textDocument/codeAction requests. These need to be queued better as well.

Is any of you able to share the project with steps how I could reproduce the slow down. Will help better understanding what is going on.

@Jessidhia
Copy link

Jessidhia commented Apr 10, 2017

I disabled and re-enabled eslint using ⌘+Shift+P, waited until the output stopped, cleared the output, and then wrote (const thread of threads) {ENTER (continuation of a for statement head). This is the full output at that point:

[Trace - 7:12:35 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:35 PM] Sending request 'textDocument/codeAction - (15)'.
[Trace - 7:12:35 PM] Sending request 'textDocument/codeAction - (16)'.
[Trace - 7:12:35 PM] Received response 'textDocument/codeAction - (15)' in 3ms.
[Trace - 7:12:35 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:35 PM] Received response 'textDocument/codeAction - (16)' in 138ms.
[Trace - 7:12:35 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:35 PM] Sending request 'textDocument/codeAction - (17)'.
[Trace - 7:12:35 PM] Sending request 'textDocument/codeAction - (18)'.
[Trace - 7:12:35 PM] Received response 'textDocument/codeAction - (17)' in 7ms.
[Trace - 7:12:35 PM] Sending request 'textDocument/codeAction - (19)'.
[Trace - 7:12:35 PM] Sending request 'textDocument/codeAction - (20)'.
[Trace - 7:12:35 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:35 PM] Sending request 'textDocument/codeAction - (21)'.
[Trace - 7:12:35 PM] Sending request 'textDocument/codeAction - (22)'.
[Trace - 7:12:35 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:35 PM] Sending request 'textDocument/codeAction - (23)'.
[Trace - 7:12:35 PM] Sending request 'textDocument/codeAction - (24)'.
[Trace - 7:12:35 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:35 PM] Received response 'textDocument/codeAction - (18)' in 156ms.
[Trace - 7:12:35 PM] Received response 'textDocument/codeAction - (19)' in 148ms.
[Trace - 7:12:35 PM] Received response 'textDocument/codeAction - (20)' in 148ms.
[Trace - 7:12:35 PM] Sending request 'textDocument/codeAction - (25)'.
[Trace - 7:12:35 PM] Sending request 'textDocument/codeAction - (26)'.
[Trace - 7:12:36 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (27)'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (28)'.
[Trace - 7:12:36 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (29)'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (30)'.
[Trace - 7:12:36 PM] Received response 'textDocument/codeAction - (21)' in 376ms.
[Trace - 7:12:36 PM] Received response 'textDocument/codeAction - (22)' in 375ms.
[Trace - 7:12:36 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:36 PM] Received response 'textDocument/codeAction - (23)' in 445ms.
[Trace - 7:12:36 PM] Received response 'textDocument/codeAction - (24)' in 441ms.
[Trace - 7:12:36 PM] Received response 'textDocument/codeAction - (25)' in 411ms.
[Trace - 7:12:36 PM] Received response 'textDocument/codeAction - (26)' in 410ms.
[Trace - 7:12:36 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:36 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (31)'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (32)'.
[Trace - 7:12:36 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:36 PM] Received response 'textDocument/codeAction - (27)' in 515ms.
[Trace - 7:12:36 PM] Received response 'textDocument/codeAction - (28)' in 512ms.
[Trace - 7:12:36 PM] Received response 'textDocument/codeAction - (29)' in 385ms.
[Trace - 7:12:36 PM] Received response 'textDocument/codeAction - (30)' in 385ms.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (33)'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (34)'.
[Trace - 7:12:36 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:36 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (35)'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (36)'.
[Trace - 7:12:36 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (37)'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (38)'.
[Trace - 7:12:36 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (39)'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (40)'.
[Trace - 7:12:36 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:36 PM] Received response 'textDocument/codeAction - (31)' in 245ms.
[Trace - 7:12:36 PM] Received response 'textDocument/codeAction - (32)' in 245ms.
[Trace - 7:12:36 PM] Received response 'textDocument/codeAction - (33)' in 238ms.
[Trace - 7:12:36 PM] Received response 'textDocument/codeAction - (34)' in 238ms.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (41)'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (42)'.
[Trace - 7:12:36 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (43)'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (44)'.
[Trace - 7:12:36 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:36 PM] Received response 'textDocument/codeAction - (35)' in 232ms.
[Trace - 7:12:36 PM] Received response 'textDocument/codeAction - (36)' in 231ms.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (45)'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (46)'.
[Trace - 7:12:36 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (47)'.
[Trace - 7:12:36 PM] Sending request 'textDocument/codeAction - (48)'.
[Trace - 7:12:37 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (37)' in 339ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (38)' in 333ms.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (49)'.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (50)'.
[Trace - 7:12:37 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (51)'.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (52)'.
[Trace - 7:12:37 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (39)' in 343ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (40)' in 342ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (41)' in 321ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (42)' in 320ms.
[Trace - 7:12:37 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (43)' in 388ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (44)' in 387ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (45)' in 321ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (46)' in 321ms.
[Trace - 7:12:37 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (53)'.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (54)'.
[Trace - 7:12:37 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (55)'.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (56)'.
[Trace - 7:12:37 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (47)' in 377ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (48)' in 375ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (49)' in 318ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (50)' in 317ms.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (57)'.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (58)'.
[Trace - 7:12:37 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (51)' in 440ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (52)' in 439ms.
[Trace - 7:12:37 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (53)' in 328ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (54)' in 327ms.
[Trace - 7:12:37 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:37 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:37 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (55)' in 351ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (56)' in 350ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (57)' in 287ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (58)' in 287ms.
[Trace - 7:12:37 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (59)'.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (60)'.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (61)'.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (62)'.
[Trace - 7:12:37 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (59)' in 90ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (60)' in 89ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (61)' in 82ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (62)' in 81ms.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (63)'.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (64)'.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (63)' in 1ms.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (64)' in 0ms.
[Trace - 7:12:37 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (65)'.
[Trace - 7:12:37 PM] Sending request 'textDocument/codeAction - (66)'.
[Trace - 7:12:37 PM] Received response 'textDocument/codeAction - (65)' in 4ms.
[Trace - 7:12:38 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:38 PM] Sending request 'textDocument/codeAction - (67)'.
[Trace - 7:12:38 PM] Sending request 'textDocument/codeAction - (68)'.
[Trace - 7:12:38 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:38 PM] Sending request 'textDocument/codeAction - (69)'.
[Trace - 7:12:38 PM] Sending request 'textDocument/codeAction - (70)'.
[Trace - 7:12:38 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:38 PM] Sending request 'textDocument/codeAction - (71)'.
[Trace - 7:12:38 PM] Sending request 'textDocument/codeAction - (72)'.
[Trace - 7:12:38 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:38 PM] Received response 'textDocument/codeAction - (66)' in 726ms.
[Trace - 7:12:38 PM] Sending request 'textDocument/codeAction - (73)'.
[Trace - 7:12:38 PM] Sending request 'textDocument/codeAction - (74)'.
[Trace - 7:12:38 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:38 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:38 PM] Sending request 'textDocument/codeAction - (75)'.
[Trace - 7:12:38 PM] Sending request 'textDocument/codeAction - (76)'.
[Trace - 7:12:39 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:39 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:39 PM] Sending request 'textDocument/codeAction - (77)'.
[Trace - 7:12:39 PM] Sending request 'textDocument/codeAction - (78)'.
[Trace - 7:12:39 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:39 PM] Sending request 'textDocument/codeAction - (79)'.
[Trace - 7:12:39 PM] Sending request 'textDocument/codeAction - (80)'.
[Trace - 7:12:39 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:39 PM] Received response 'textDocument/codeAction - (67)' in 1121ms.
[Trace - 7:12:39 PM] Received response 'textDocument/codeAction - (68)' in 1120ms.
[Trace - 7:12:39 PM] Sending request 'textDocument/codeAction - (81)'.
[Trace - 7:12:39 PM] Sending request 'textDocument/codeAction - (82)'.
[Trace - 7:12:39 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:39 PM] Sending request 'textDocument/codeAction - (83)'.
[Trace - 7:12:39 PM] Sending request 'textDocument/codeAction - (84)'.
[Trace - 7:12:39 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:39 PM] Sending request 'textDocument/codeAction - (85)'.
[Trace - 7:12:39 PM] Sending request 'textDocument/codeAction - (86)'.
[Trace - 7:12:39 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:39 PM] Sending request 'textDocument/codeAction - (87)'.
[Trace - 7:12:39 PM] Sending request 'textDocument/codeAction - (88)'.
[Trace - 7:12:39 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:39 PM] Received response 'textDocument/codeAction - (69)' in 1411ms.
[Trace - 7:12:39 PM] Received response 'textDocument/codeAction - (70)' in 1410ms.
[Trace - 7:12:40 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:40 PM] Sending notification 'textDocument/didChange'.
[Trace - 7:12:40 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:40 PM] Received response 'textDocument/codeAction - (71)' in 1891ms.
[Trace - 7:12:40 PM] Received response 'textDocument/codeAction - (72)' in 1889ms.
[Trace - 7:12:40 PM] Received response 'textDocument/codeAction - (73)' in 1703ms.
[Trace - 7:12:40 PM] Received response 'textDocument/codeAction - (74)' in 1703ms.
[Trace - 7:12:40 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:41 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:41 PM] Received response 'textDocument/codeAction - (75)' in 2639ms.
[Trace - 7:12:41 PM] Received response 'textDocument/codeAction - (76)' in 2638ms.
[Trace - 7:12:41 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:42 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:42 PM] Received response 'textDocument/codeAction - (77)' in 3448ms.
[Trace - 7:12:42 PM] Received response 'textDocument/codeAction - (78)' in 3445ms.
[Trace - 7:12:42 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:42 PM] Received response 'textDocument/codeAction - (79)' in 3848ms.
[Trace - 7:12:42 PM] Received response 'textDocument/codeAction - (80)' in 3847ms.
[Trace - 7:12:42 PM] Received response 'textDocument/codeAction - (81)' in 3752ms.
[Trace - 7:12:42 PM] Received response 'textDocument/codeAction - (82)' in 3752ms.
[Trace - 7:12:43 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:43 PM] Received response 'textDocument/codeAction - (83)' in 4256ms.
[Trace - 7:12:43 PM] Received response 'textDocument/codeAction - (84)' in 4255ms.
[Trace - 7:12:43 PM] Received response 'textDocument/codeAction - (85)' in 4221ms.
[Trace - 7:12:43 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:43 PM] Received response 'textDocument/codeAction - (86)' in 4700ms.
[Trace - 7:12:44 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:44 PM] Received response 'textDocument/codeAction - (87)' in 5087ms.
[Trace - 7:12:44 PM] Received response 'textDocument/codeAction - (88)' in 5085ms.
[Trace - 7:12:44 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:12:45 PM] Received notification 'textDocument/publishDiagnostics'.

You can see the increasing delays towards the end.

@mwadden
Copy link

mwadden commented Apr 10, 2017

I haven't yet tried the new version you posted a few days ago but I wanted to share this trace from a few mins ago. I'm currently working on a file that's 472 lines long.

I'm going to try your latest version now and I'll report back once I get a sense of if it's helping or not.

[Info  - 3:25:47 PM] ESLint server is running.
[Info  - 3:25:49 PM] ESLint library loaded from: /Users/mark/repos/scout-client/node_modules/eslint/lib/api.js
[Trace - 4:56:21 PM] Sending notification '$/setTraceNotification'.
[Trace - 4:56:21 PM] Sending notification 'workspace/didChangeConfiguration'.
[Trace - 4:56:22 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:23 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:23 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:23 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:23 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:23 PM] Received notification 'eslint/status'.
[Trace - 4:56:24 PM] Sending request 'textDocument/codeAction - (1268)'.
[Trace - 4:56:24 PM] Received response 'textDocument/codeAction - (1268)' in 27ms.
[Trace - 4:56:27 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:27 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:27 PM] Sending request 'textDocument/codeAction - (1269)'.
[Trace - 4:56:28 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:28 PM] Sending request 'textDocument/codeAction - (1270)'.
[Trace - 4:56:28 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:28 PM] Sending request 'textDocument/codeAction - (1271)'.
[Trace - 4:56:28 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:28 PM] Sending request 'textDocument/codeAction - (1272)'.
[Trace - 4:56:28 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:28 PM] Sending request 'textDocument/codeAction - (1273)'.
[Trace - 4:56:28 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:28 PM] Sending request 'textDocument/codeAction - (1274)'.
[Trace - 4:56:28 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:28 PM] Sending request 'textDocument/codeAction - (1275)'.
[Trace - 4:56:28 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:28 PM] Sending request 'textDocument/codeAction - (1276)'.
[Trace - 4:56:29 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:29 PM] Sending request 'textDocument/codeAction - (1277)'.
[Trace - 4:56:29 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:29 PM] Sending request 'textDocument/codeAction - (1278)'.
[Trace - 4:56:29 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:29 PM] Received notification 'eslint/status'.
[Trace - 4:56:29 PM] Received response 'textDocument/codeAction - (1269)' in 1370ms.
[Trace - 4:56:29 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:30 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:30 PM] Received notification 'eslint/status'.
[Trace - 4:56:30 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:30 PM] Sending request 'textDocument/codeAction - (1279)'.
[Trace - 4:56:30 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:30 PM] Sending request 'textDocument/codeAction - (1280)'.
[Trace - 4:56:31 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:31 PM] Sending request 'textDocument/codeAction - (1281)'.
[Trace - 4:56:31 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:31 PM] Received notification 'eslint/status'.
[Trace - 4:56:31 PM] Received response 'textDocument/codeAction - (1270)' in 3813ms.
[Trace - 4:56:32 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:32 PM] Sending request 'textDocument/codeAction - (1282)'.
[Trace - 4:56:32 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:32 PM] Sending request 'textDocument/codeAction - (1283)'.
[Trace - 4:56:32 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:32 PM] Sending request 'textDocument/codeAction - (1284)'.
[Trace - 4:56:33 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:33 PM] Received notification 'eslint/status'.
[Trace - 4:56:33 PM] Received response 'textDocument/codeAction - (1271)' in 4893ms.
[Trace - 4:56:33 PM] Sending request 'textDocument/codeAction - (1285)'.
[Trace - 4:56:33 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:33 PM] Sending request 'textDocument/codeAction - (1286)'.
[Trace - 4:56:33 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:33 PM] Sending request 'textDocument/codeAction - (1287)'.
[Trace - 4:56:33 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:33 PM] Sending request 'textDocument/codeAction - (1288)'.
[Trace - 4:56:33 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:33 PM] Sending request 'textDocument/codeAction - (1289)'.
[Trace - 4:56:33 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:33 PM] Sending request 'textDocument/codeAction - (1290)'.
[Trace - 4:56:34 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:34 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:34 PM] Received notification 'eslint/status'.
[Trace - 4:56:34 PM] Received response 'textDocument/codeAction - (1272)' in 6233ms.
[Trace - 4:56:35 PM] Sending notification 'textDocument/didChange'.
[Trace - 4:56:35 PM] Sending notification 'textDocument/didSave'.
[Trace - 4:56:35 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:35 PM] Received notification 'eslint/status'.
[Trace - 4:56:35 PM] Received response 'textDocument/codeAction - (1273)' in 7342ms.
[Trace - 4:56:35 PM] Received response 'textDocument/codeAction - (1274)' in 7177ms.
[Trace - 4:56:37 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:37 PM] Received notification 'eslint/status'.
[Trace - 4:56:38 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:38 PM] Received notification 'eslint/status'.
[Trace - 4:56:38 PM] Received response 'textDocument/codeAction - (1275)' in 9908ms.
[Trace - 4:56:39 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:39 PM] Received notification 'eslint/status'.
[Trace - 4:56:39 PM] Received response 'textDocument/codeAction - (1276)' in 11039ms.
[Trace - 4:56:39 PM] Received response 'textDocument/codeAction - (1277)' in 10899ms.
[Trace - 4:56:41 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:41 PM] Received notification 'eslint/status'.
[Trace - 4:56:41 PM] Received response 'textDocument/codeAction - (1278)' in 12266ms.
[Trace - 4:56:42 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:42 PM] Received notification 'eslint/status'.
[Trace - 4:56:44 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:44 PM] Received notification 'eslint/status'.
[Trace - 4:56:47 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:47 PM] Received notification 'eslint/status'.
[Trace - 4:56:47 PM] Received response 'textDocument/codeAction - (1279)' in 16471ms.
[Trace - 4:56:47 PM] Received response 'textDocument/codeAction - (1280)' in 16393ms.
[Trace - 4:56:50 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:50 PM] Received notification 'eslint/status'.
[Trace - 4:56:50 PM] Received response 'textDocument/codeAction - (1281)' in 19501ms.
[Trace - 4:56:52 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:52 PM] Received notification 'eslint/status'.
[Trace - 4:56:53 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:53 PM] Received notification 'eslint/status'.
[Trace - 4:56:53 PM] Received response 'textDocument/codeAction - (1282)' in 21026ms.
[Trace - 4:56:54 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:54 PM] Received notification 'eslint/status'.
[Trace - 4:56:54 PM] Received response 'textDocument/codeAction - (1283)' in 22170ms.
[Trace - 4:56:54 PM] Received response 'textDocument/codeAction - (1284)' in 22122ms.
[Trace - 4:56:54 PM] Received response 'textDocument/codeAction - (1285)' in 21816ms.
[Trace - 4:56:56 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:56 PM] Received notification 'eslint/status'.
[Trace - 4:56:57 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:57 PM] Received notification 'eslint/status'.
[Trace - 4:56:57 PM] Received response 'textDocument/codeAction - (1286)' in 24126ms.
[Trace - 4:56:58 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:58 PM] Received notification 'eslint/status'.
[Trace - 4:56:58 PM] Received response 'textDocument/codeAction - (1287)' in 25030ms.
[Trace - 4:56:59 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:56:59 PM] Received notification 'eslint/status'.
[Trace - 4:56:59 PM] Received response 'textDocument/codeAction - (1288)' in 25827ms.
[Trace - 4:57:00 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:57:00 PM] Received notification 'eslint/status'.
[Trace - 4:57:00 PM] Received response 'textDocument/codeAction - (1289)' in 26683ms.
[Trace - 4:57:01 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:57:01 PM] Received notification 'eslint/status'.
[Trace - 4:57:01 PM] Received response 'textDocument/codeAction - (1290)' in 27543ms.
[Trace - 4:57:02 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:57:02 PM] Received notification 'eslint/status'.
[Trace - 4:57:03 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 4:57:03 PM] Received notification 'eslint/status'.

@dbaeumer
Copy link
Member

@Kovensky @mwadden thanks a lot for the traces. I know better understand what is going on. I will look into a new version of the extension for you. From my first analysis this will requires some changes in the VS Code core as well since we are triggering far too many codeAction requests.

@dbaeumer
Copy link
Member

We fixed parts of this in master which is already in insider (thanks to @jrieken). However there is more work to do which has to happen in the ESLint extension. The problem is that codeAction requests should only be sent if the diagnostic the code action is requested for contains a ESLint generated error. Otherwise ESLint is not able to provide any code action.

@dbaeumer
Copy link
Member

@Kovensky @mwadden @benduran @dlong500

Attached a new version of the eslint extension. Please follow the steps in #215 (comment) to install.

The extension requires features from the insider build to work optimal. It is working with stable as well but it will not profit so much.

Please let me know if this improves your experience (note that I am out on vacation next week so it will take a little for me to respond).

vscode-eslint-1.2.9.zip

@Jessidhia
Copy link

Jessidhia commented Apr 14, 2017

Running code --install-extension vscode-eslint-1.2.9.vsix with the new extension is failing with:

[ { Error: ENOENT: no such file or directory, open '~/.vscode-insiders/extensions/dbaeumer.vscode-eslint-1.2.9/package.json'
    errno: -2,
    code: 'ENOENT',
    syscall: 'open',
    path: '~/.vscode-insiders/extensions/dbaeumer.vscode-eslint-1.2.9/package.json' } ]

EDIT: removing the previous extension before trying to install again worked.

@dbaeumer
Copy link
Member

@Kovensky sorry for that. Since I didn't official publish I didn't increment the version number.

@benduran
Copy link
Author

Wanted to mention that the latest version you've provided has improved the performance again, but there is still some "catching-up" that eslint is doing when my settings are set to run onType. I will work on getting a trace for you within the next few days.

@dbaeumer
Copy link
Member

@benduran thanks. Would you be able to share your workspace. Would ease tracking this down further.

@mwadden
Copy link

mwadden commented May 1, 2017

Quick update... I've been using the version from Apr 4th for a few weeks now and it's been great. No noticeable concerns. I just installed the latest version from Apr 13th now so I'll give a few days and report back.

Thx again for the quick turnaround on fixing this, it's made vscode usable again!

@mwadden
Copy link

mwadden commented May 5, 2017

Following up from my last comment, it's been a few days now of heavy usage and everything seems great still.

@dbaeumer
Copy link
Member

Great to hear.

@ItsNoHax
Copy link

I have everything up to date, including the ESLint plugin with latest version and this is still happening.
For me this started appearing after updating Watchman to the latest version.

@dbaeumer
Copy link
Member

@ItsNoHax can you please open a new issue with steps to reproduce (best would be a clonable GitHub repository).

@ItsNoHax
Copy link

Not sure I can, this is happening at my work's React-Native project which has a substantial size code base which could be related to why it's sluggish.

@dbaeumer
Copy link
Member

dbaeumer commented Aug 4, 2017

@ItsNoHax something like this is hard to track down without a test case :-(

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

6 participants