Vetur: Performance Regression

Created on 23 Aug 2019  路  6Comments  路  Source: vuejs/vetur

  • [X] I have searched through existing issues
  • [X] I have read through docs
  • [X] I have read FAQ

Info

  • Platform: Windows 10
  • Vetur version: 0.22.2
  • VS Code version: 1.37.1
    Loaded bundled [email protected].

Problem

Intellisense in Vue files is unusable in my project. I was browsing through issues and saw a couple closed ones related to this and tried out your test release (https://github.com/vuejs/vetur/releases/tag/perf) which actually made things work partially (intellisense was fast but wrong). But something regressed since then and I am seeing huge slowdowns. Best I would get is ~10 seconds, but most of the time its 30+ seconds as you can see from trace below.

[Trace - 11:40:26 AM] Received response 'textDocument/codeAction - (2)' in 46148ms.
[Trace - 11:40:26 AM] Received response 'textDocument/documentLink - (3)' in 46148ms.
[Trace - 11:40:26 AM] Received response 'textDocument/documentColor - (4)' in 46148ms.
[Trace - 11:40:26 AM] Received response 'textDocument/codeAction - (5)' in 45336ms.
[Trace - 11:40:26 AM] Received response 'textDocument/documentColor - (6)' in 41197ms.
[Trace - 11:40:26 AM] Received response 'textDocument/documentLink - (7)' in 41197ms.
[Trace - 11:40:26 AM] Received response 'textDocument/codeAction - (8)' in 41196ms.
[Trace - 11:40:26 AM] Received response 'textDocument/documentSymbol - (9)' in 41317ms.
[Trace - 11:40:27 AM] Received response 'textDocument/codeAction - (10)' in 41482ms.
[Trace - 11:40:27 AM] Received response 'textDocument/hover - (11)' in 40887ms.
[Trace - 11:40:27 AM] Received response 'textDocument/documentHighlight - (12)' in 40848ms.
[Trace - 11:40:27 AM] Received response 'textDocument/codeAction - (13)' in 40813ms.
[Trace - 11:40:28 AM] Received response 'textDocument/completion - (14)' in 40010ms.
[Trace - 11:40:28 AM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 11:40:29 AM] Received response 'textDocument/documentSymbol - (15)' in 40563ms.
[Trace - 11:40:29 AM] Sending request 'textDocument/codeAction - (42)'.
[Trace - 11:40:29 AM] Sending notification '$/cancelRequest'.
[Trace - 11:40:29 AM] Received response 'textDocument/codeAction - (16)' in 40759ms.
[Trace - 11:40:29 AM] Received response 'textDocument/documentLink - (17)' in 40644ms.
[Trace - 11:40:29 AM] Received response 'textDocument/documentColor - (18)' in 40643ms.
[Trace - 11:40:29 AM] Received response 'textDocument/codeAction - (19)' in 39064ms.
[Trace - 11:40:30 AM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 11:40:30 AM] Sending request 'textDocument/codeAction - (43)'.
[Trace - 11:40:30 AM] Sending notification '$/cancelRequest'.
[Trace - 11:40:30 AM] Received response 'textDocument/documentSymbol - (20)' in 39990ms.
[Trace - 11:40:31 AM] Sending notification '$/cancelRequest'.
[Trace - 11:40:31 AM] Received response 'textDocument/codeAction - (21)' in 40078ms.
[Trace - 11:40:31 AM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 11:40:32 AM] Received response 'textDocument/documentSymbol - (22)' in 40800ms.
[Trace - 11:40:32 AM] Sending request 'textDocument/codeAction - (44)'.
[Trace - 11:40:32 AM] Sending notification '$/cancelRequest'.
[Trace - 11:40:32 AM] Received response 'textDocument/codeAction - (23)' in 40897ms.
[Trace - 11:40:32 AM] Received response 'textDocument/documentLink - (24)' in 40894ms.
[Trace - 11:40:32 AM] Received response 'textDocument/documentColor - (25)' in 40894ms.
[Trace - 11:40:32 AM] Received response 'textDocument/documentHighlight - (26)' in 12323ms.
[Trace - 11:40:32 AM] Received response 'textDocument/codeAction - (27)' in 12417ms.
[Trace - 11:40:33 AM] Received response 'textDocument/hover - (28)' in 12387ms.
[Trace - 11:40:33 AM] Received response 'textDocument/codeAction - (29)' in 11918ms.
[Trace - 11:40:34 AM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 11:40:34 AM] Sending request 'textDocument/codeAction - (45)'.
[Trace - 11:40:34 AM] Sending notification '$/cancelRequest'.
[Trace - 11:40:34 AM] Received response 'textDocument/completion - (30)' in 12557ms.
[Trace - 11:40:35 AM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 11:40:35 AM] Received response 'textDocument/documentLink - (31)' in 12969ms.
[Trace - 11:40:35 AM] Received response 'textDocument/documentColor - (32)' in 12969ms.
[Trace - 11:40:35 AM] Received response 'textDocument/documentSymbol - (33)' in 13024ms.
[Trace - 11:40:35 AM] Sending request 'textDocument/codeAction - (46)'.
[Trace - 11:40:35 AM] Sending notification '$/cancelRequest'.
[Trace - 11:40:35 AM] Received response 'textDocument/codeAction - (34)' in 13317ms.
[Trace - 11:40:36 AM] Received response 'textDocument/completion - (35)' in 13388ms.

duplicate perf

Most helpful comment

Any ideas or possible workarounds @octref besides splitting our entire codebase? Its basically unusable at this point

All 6 comments

Here is CPU profile.
CPU-20190823T115902.zip

My project isn't very large (yet), the src folder is 411 files over 63 folders. I am using vue-cli to generate config, here is my tsconfig.json:

{
    "compileOnSave": false,
    "compilerOptions": {
        "target": "esnext",
        "module": "esnext",
        "strict": true,
        "noImplicitThis": true,
        "jsx": "preserve",
        "importHelpers": true,
        "moduleResolution": "node",
        "esModuleInterop": true,
        "allowSyntheticDefaultImports": true,
        "experimentalDecorators": true,
        "sourceMap": true,
        "baseUrl": ".",
        "types": [
            "webpack-env",
            "mocha",
            "chai"
        ],
        "paths": {
            "@/*": [
                "src/*"
            ]
        },
        "lib": [
            "esnext",
            "dom",
            "dom.iterable",
            "scripthost"
        ]
    },
    "include": [
        "src/**/*.ts",
        "src/**/*.vue",
        "tests/**/*.ts"
    ]
}

My problem is almost the same, this is really annoying.

We are also facing the same issue. This is extension is unusable at this point.

Same, awesome extension but this is killing me.
I have resorted to splitting the TS code into a seperate file which works for me.

Any ideas or possible workarounds @octref besides splitting our entire codebase? Its basically unusable at this point

Your profile shows a lot of fs.stat and fs.readFileSync reads so I guess it's the same cause as #1442. You can subscribe for that issue and wait for next release (which I'll try to publish this weekend).

Was this page helpful?
0 / 5 - 0 ratings