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

Extremely slow performance via SSH remote in SFC files #1691

Open
3 tasks done
JoelFeiner opened this issue Jan 30, 2020 · 4 comments
Open
3 tasks done

Extremely slow performance via SSH remote in SFC files #1691

JoelFeiner opened this issue Jan 30, 2020 · 4 comments

Comments

@JoelFeiner
Copy link

JoelFeiner commented Jan 30, 2020

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: Linux
  • Vetur version: 0.23.0
  • VS Code version: 1.41.1

Problem

Extremely slow Intellisense and error detection in SFC files when using via remote SSH. It can take upwards of a minute for the suggestion menu to stop loading and show something. I also see the red squiggly lines go character by character based on typing I may have done 10-30 seconds ago, or longer. Profile is attached.

CPU-20200130T113325.zip

Vetur settings in VSCode:

    "vetur.format.defaultFormatter.html": "prettyhtml",
    "vetur.format.defaultFormatter.js": "vscode-typescript",
    "vetur.format.defaultFormatter.ts": "vscode-typescript",
    "vetur.format.options.tabSize": 4,
    "vetur.format.scriptInitialIndent": true,
    "vetur.format.styleInitialIndent": true,
    "vetur.useWorkspaceDependencies": true,
    "vetur.experimental.templateInterpolationService": true,  // with this set to false, it's very slightly faster

Typescript settings, in case those may matter:

    "tslint.autoFixOnSave": true,
    "typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
    "typescript.format.insertSpaceAfterTypeAssertion": true,
    "typescript.preferences.quoteStyle": "single",
    "typescript.suggest.completeFunctionCalls": true,
    "typescript.updateImportsOnFileMove.enabled": "always",
    "typescript.preferences.importModuleSpecifier": "non-relative",

And webpack config, in case it matters:

const path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');

module.exports = (env, argv) => {
    const isDev = (argv ? argv.mode : process.env.NODE_ENV) !== 'production';
    return {
        entry: './src/index.ts',
        module: {
            rules: [
                {
                    test: /\.tsx?$/,
                    use: [
                        {
                            loader: 'ts-loader',
                            options: {
                                appendTsSuffixTo: [/\.vue$/]
                            }
                        }
                    ],
                    exclude: /node_modules/
                },
                {
                    test: /\.vue$/,
                    loader: 'vue-loader',
                    options: {
                        compilerOptions: {
                            preserveWhitespace: false
                        }
                    },
                    exclude: /node_modules/
                },
                {
                    test: /\.css$/,
                    oneOf: [
                        // this matches `<style module>`
                        {
                            resourceQuery: /module/,
                            use: [
                                isDev ? 'vue-style-loader' : MiniCssExtractPlugin.loader,
                                {
                                    loader: 'css-loader',
                                    options: {
                                        modules: {
                                            localIdentName: '[local]_[hash:base64:5]'
                                        }
                                    }
                                }
                            ]
                        },
                        // this matches plain `<style>` or `<style scoped>`
                        {
                            use: [
                                isDev ? 'vue-style-loader' : MiniCssExtractPlugin.loader,
                                'css-loader'
                            ]
                        }
                    ]
                },
                {
                    loader: 'webpack-modernizr-loader',
                    test: /\.modernizrrc\.js$/
                },
                {
                    test: /\.mp3$/,
                    loader: 'file-loader',
                    options: {
                        name: '[name].[ext]'
                    }
                }
            ]
        },
        resolve: {
            extensions: ['.tsx', '.ts', '.js'],
            plugins: [
                new TsconfigPathsPlugin()
            ],
            alias: {
                modernizr$: path.resolve(__dirname, '.modernizrrc.js')
            }
        },
        plugins: [
            new VueLoaderPlugin(),
            new MiniCssExtractPlugin({
                filename: 'output.bundle.css'
            })
        ],
        output: {
            filename: 'output.bundle.js',
            path: path.resolve(__dirname, 'dist'),
            library: 'Output',
            libraryTarget: 'window'
        },
        node: {
            fs: 'empty'
        }
    };
};

And tsconfig settings:

{
    "compilerOptions": {
        "outDir": "./dist/",
        "target": "es2020",
        "module": "esnext",
        "strict": true,
        "jsx": "preserve",
        "importHelpers": true,
        "moduleResolution": "node",
        "esModuleInterop": true,
        "allowSyntheticDefaultImports": true,
        "sourceMap": true,
        "allowJs": true,
        "experimentalDecorators": true,
        "lib": [
            "es2016",
            "dom",
            "dom.iterable",
            "scripthost"
        ],
        "baseUrl": ".",
        "paths": {
            "@/*": [
                "./src/*"
            ]
        }
    },
    "include": [
        "src/**/*.ts",
        "src/**/*.tsx",
        "src/**/*.vue",
        "tests/**/*.ts",
        "tests/**/*.tsx"
    ],
    "exclude": [
        "node_modules"
    ]
}
@JoelFeiner
Copy link
Author

It's now taking upwards of 5+ minutes to save a file.

@octref Is there some set of settings I can use or something I can do to improve this situation? As it is, Vetur is essentially unusable. A fix would be nice, but a tweak I could do on my end would be just fine.

@octref octref added the perf label Jun 5, 2020
@octref
Copy link
Member

octref commented Jun 5, 2020

This sounds like your cloud machine is slow. Can you try spinning up a higher spec machine to see if that's the case?

Also, does this happen to a normal TS project without .vue files?

@JoelFeiner
Copy link
Author

@octref The remote machine has 8 cores (Xeon E312xx, 2.6 MHz), 8 GB RAM + 8 GB of swap. It may not be the beefiest possible machine, but I feel like it should be able to handle intellisense.

.ts and .js files do not have performance issues, aside from some very slight lag at the start. I don't expect remote connections to be 100% as fast as local. But generally it's pretty snappy.

Here's some logging from VLS on the remote:

[Trace - 10:37:04 AM] Sending request 'initialize - (0)'.
[Trace - 10:37:06 AM] Received notification 'window/logMessage'.
Loaded typescript@3.8.2 from workspace.
[Trace - 10:37:06 AM] Received notification 'window/logMessage'.
Vetur initialized
[Trace - 10:37:06 AM] Received response 'initialize - (0)' in 2377ms.
[Trace - 10:37:06 AM] Sending notification 'initialized'.
[Trace - 10:37:06 AM] Sending notification 'workspace/didChangeConfiguration'.
[Trace - 10:37:06 AM] Sending notification 'textDocument/didOpen'.
[Trace - 10:37:06 AM] Received request 'client/registerCapability - (0)'.
[Trace - 10:37:06 AM] Sending response 'client/registerCapability - (0)'. Processing request took 1ms
[Trace - 10:37:06 AM] Sending request 'textDocument/documentSymbol - (1)'.
[Trace - 10:37:06 AM] Sending request 'textDocument/documentLink - (2)'.
[Trace - 10:37:06 AM] Sending request 'textDocument/documentColor - (3)'.
[Trace - 10:37:11 AM] Received response 'textDocument/documentSymbol - (1)' in 4527ms.
[Trace - 10:37:13 AM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 10:37:13 AM] Received response 'textDocument/documentLink - (2)' in 6998ms.
[Trace - 10:37:13 AM] Received response 'textDocument/documentColor - (3)' in 6998ms.
[Trace - 10:37:23 AM] Sending request 'textDocument/codeAction - (4)'.
[Trace - 10:37:23 AM] Received response 'textDocument/codeAction - (4)' in 378ms.
[Trace - 10:37:38 AM] Sending request 'textDocument/codeAction - (5)'.
[Trace - 10:37:38 AM] Received response 'textDocument/codeAction - (5)' in 273ms.
[Trace - 10:37:39 AM] Sending notification 'textDocument/didChange'.
[Trace - 10:37:39 AM] Sending notification 'textDocument/didChange'.
[Trace - 10:37:39 AM] Sending request 'textDocument/completion - (6)'.
[Trace - 10:37:39 AM] Sending notification '$/cancelRequest'.
[Trace - 10:37:39 AM] Sending notification 'textDocument/didChange'.
[Trace - 10:37:39 AM] Sending request 'textDocument/completion - (7)'.
[Trace - 10:37:40 AM] Sending request 'textDocument/documentLink - (8)'.
[Trace - 10:37:40 AM] Sending request 'textDocument/documentColor - (9)'.
[Trace - 10:37:40 AM] Sending request 'textDocument/codeAction - (10)'.
[Trace - 10:37:40 AM] Sending request 'textDocument/codeAction - (11)'.
[Trace - 10:37:40 AM] Sending notification '$/cancelRequest'.
[Trace - 10:37:41 AM] Received response 'textDocument/completion - (6)' in 2016ms.
[Trace - 10:37:41 AM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 10:37:41 AM] Sending request 'textDocument/codeAction - (12)'.
[Trace - 10:37:41 AM] Sending notification '$/cancelRequest'.
[Trace - 10:37:42 AM] Received response 'textDocument/completion - (7)' in 2163ms.
[Trace - 10:37:42 AM] Sending request 'completionItem/resolve - (13)'.
[Trace - 10:37:42 AM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 10:37:42 AM] Received response 'textDocument/documentLink - (8)' in 2942ms.
[Trace - 10:37:42 AM] Received response 'textDocument/documentColor - (9)' in 2942ms.
[Trace - 10:37:43 AM] Received response 'textDocument/codeAction - (10)' in 3004ms.
[Trace - 10:37:43 AM] Sending request 'textDocument/codeAction - (14)'.
[Trace - 10:37:43 AM] Sending notification '$/cancelRequest'.
[Trace - 10:37:43 AM] Received response 'textDocument/codeAction - (11)' in 2670ms.
[Trace - 10:37:43 AM] Received response 'textDocument/codeAction - (12)' in 1657ms.
[Trace - 10:37:43 AM] Received response 'completionItem/resolve - (13)' in 1820ms.
[Trace - 10:37:44 AM] Received response 'textDocument/codeAction - (14)' in 846ms.
[Trace - 10:37:45 AM] Sending request 'textDocument/documentSymbol - (15)'.
[Trace - 10:37:45 AM] Received response 'textDocument/documentSymbol - (15)' in 77ms.

And here's some local:

[Trace - 10:35:20 AM] Sending request 'initialize - (0)'.
[Trace - 10:35:22 AM] Received notification 'window/logMessage'.
Loaded typescript@3.8.2 from workspace.
[Trace - 10:35:22 AM] Received notification 'window/logMessage'.
Vetur initialized
[Trace - 10:35:22 AM] Received response 'initialize - (0)' in 2268ms.
[Trace - 10:35:22 AM] Sending notification 'initialized'.
[Trace - 10:35:22 AM] Sending notification 'workspace/didChangeConfiguration'.
[Trace - 10:35:22 AM] Sending notification 'textDocument/didOpen'.
[Trace - 10:35:22 AM] Received request 'client/registerCapability - (0)'.
[Trace - 10:35:22 AM] Sending response 'client/registerCapability - (0)'. Processing request took 0ms
[Trace - 10:35:23 AM] Sending notification 'textDocument/didClose'.
[Trace - 10:35:25 AM] Sending notification 'textDocument/didOpen'.
[Trace - 10:35:25 AM] Sending request 'textDocument/documentColor - (1)'.
[Trace - 10:35:25 AM] Sending request 'textDocument/documentLink - (2)'.
[Trace - 10:35:25 AM] Sending request 'textDocument/codeAction - (3)'.
[Trace - 10:35:25 AM] Sending request 'textDocument/documentSymbol - (4)'.
[Trace - 10:35:25 AM] Sending notification '$/cancelRequest'.
[Trace - 10:35:25 AM] Sending request 'textDocument/documentSymbol - (5)'.
[Trace - 10:35:25 AM] Sending request 'textDocument/codeAction - (6)'.
[Trace - 10:35:25 AM] Sending notification '$/cancelRequest'.
[Trace - 10:35:26 AM] Sending request 'textDocument/hover - (7)'.
[Trace - 10:35:26 AM] Sending notification '$/cancelRequest'.
[Trace - 10:35:27 AM] Sending request 'textDocument/codeAction - (8)'.
[Trace - 10:35:27 AM] Sending notification '$/cancelRequest'.
[Trace - 10:35:28 AM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 10:35:28 AM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 10:35:28 AM] Received response 'textDocument/documentColor - (1)' in 2974ms.
[Trace - 10:35:28 AM] Received response 'textDocument/documentLink - (2)' in 2975ms.
[Trace - 10:35:28 AM] Received response 'textDocument/codeAction - (3)' in 2974ms.
[Trace - 10:35:28 AM] Received response 'textDocument/documentSymbol - (4)' in 2804ms.
[Trace - 10:35:28 AM] Received response 'textDocument/documentSymbol - (5)' in 2885ms.
[Trace - 10:35:29 AM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 10:35:30 AM] Received response 'textDocument/codeAction - (6)' in 4016ms.
[Trace - 10:35:30 AM] Received response 'textDocument/hover - (7)' in 4220ms.
[Trace - 10:35:30 AM] Received response 'textDocument/codeAction - (8)' in 3432ms.
[Trace - 10:35:35 AM] Sending request 'textDocument/codeAction - (9)'.
[Trace - 10:35:35 AM] Received response 'textDocument/codeAction - (9)' in 127ms.
[Trace - 10:35:36 AM] Sending notification 'textDocument/didChange'.
[Trace - 10:35:36 AM] Sending request 'textDocument/completion - (10)'.
[Trace - 10:35:36 AM] Sending notification '$/cancelRequest'.
[Trace - 10:35:36 AM] Sending notification 'textDocument/didChange'.
[Trace - 10:35:36 AM] Sending request 'textDocument/completion - (11)'.
[Trace - 10:35:37 AM] Sending request 'textDocument/documentLink - (12)'.
[Trace - 10:35:37 AM] Sending request 'textDocument/documentColor - (13)'.
[Trace - 10:35:37 AM] Sending request 'textDocument/codeAction - (14)'.
[Trace - 10:35:37 AM] Received response 'textDocument/completion - (10)' in 1207ms.
[Trace - 10:35:37 AM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 10:35:37 AM] Received response 'textDocument/completion - (11)' in 1121ms.
[Trace - 10:35:37 AM] Sending request 'completionItem/resolve - (15)'.
[Trace - 10:35:37 AM] Sending request 'textDocument/codeAction - (16)'.
[Trace - 10:35:37 AM] Sending notification '$/cancelRequest'.
[Trace - 10:35:38 AM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 10:35:38 AM] Received response 'textDocument/documentLink - (12)' in 1602ms.
[Trace - 10:35:38 AM] Received response 'textDocument/documentColor - (13)' in 1601ms.
[Trace - 10:35:38 AM] Received response 'textDocument/codeAction - (14)' in 1716ms.
[Trace - 10:35:38 AM] Sending notification '$/cancelRequest'.
[Trace - 10:35:38 AM] Sending notification '$/cancelRequest'.
[Trace - 10:35:38 AM] Sending notification 'textDocument/didChange'.
[Trace - 10:35:38 AM] Sending request 'completionItem/resolve - (17)'.
[Trace - 10:35:38 AM] Sending notification '$/cancelRequest'.
[Trace - 10:35:38 AM] Sending notification 'textDocument/didChange'.
[Trace - 10:35:38 AM] Sending request 'completionItem/resolve - (18)'.
[Trace - 10:35:39 AM] Sending notification '$/cancelRequest'.
[Trace - 10:35:39 AM] Sending notification 'textDocument/didChange'.
[Trace - 10:35:39 AM] Sending request 'completionItem/resolve - (19)'.
[Trace - 10:35:39 AM] Received response 'completionItem/resolve - (15)' in 1114ms.
[Trace - 10:35:39 AM] Received response 'textDocument/codeAction - (16)' in 1204ms.
[Trace - 10:35:39 AM] Sending notification '$/cancelRequest'.
[Trace - 10:35:39 AM] Sending notification 'textDocument/didChange'.
[Trace - 10:35:39 AM] Sending request 'completionItem/resolve - (20)'.
[Trace - 10:35:39 AM] Sending notification '$/cancelRequest'.
[Trace - 10:35:39 AM] Sending notification 'textDocument/didChange'.
[Trace - 10:35:39 AM] Sending request 'completionItem/resolve - (21)'.
[Trace - 10:35:39 AM] Received response 'completionItem/resolve - (17)' in 648ms.
[Trace - 10:35:39 AM] Sending notification 'textDocument/didChange'.
[Trace - 10:35:39 AM] Sending request 'textDocument/completion - (22)'.
[Trace - 10:35:39 AM] Sending request 'textDocument/documentLink - (23)'.
[Trace - 10:35:39 AM] Sending request 'textDocument/documentColor - (24)'.
[Trace - 10:35:39 AM] Sending request 'textDocument/codeAction - (25)'.
[Trace - 10:35:40 AM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 10:35:40 AM] Received response 'completionItem/resolve - (18)' in 1508ms.
[Trace - 10:35:40 AM] Sending request 'textDocument/codeAction - (26)'.
[Trace - 10:35:40 AM] Sending notification '$/cancelRequest'.
[Trace - 10:35:41 AM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 10:35:41 AM] Received response 'completionItem/resolve - (19)' in 2161ms.
[Trace - 10:35:41 AM] Sending notification '$/cancelRequest'.
[Trace - 10:35:41 AM] Received response 'completionItem/resolve - (20)' in 2142ms.
[Trace - 10:35:41 AM] Received response 'completionItem/resolve - (21)' in 2180ms.
[Trace - 10:35:41 AM] Sending notification 'textDocument/didChange'.
[Trace - 10:35:41 AM] Sending request 'textDocument/codeAction - (27)'.
[Trace - 10:35:41 AM] Sending notification '$/cancelRequest'.
[Trace - 10:35:41 AM] Received response 'textDocument/completion - (22)' in 2132ms.
[Trace - 10:35:41 AM] Received response 'textDocument/documentLink - (23)' in 1965ms.
[Trace - 10:35:41 AM] Received response 'textDocument/documentColor - (24)' in 1965ms.

These numbers are pretty big for what I suspect they are doing.

@yoyo930021
Copy link
Member

You can follow up #2328 and #2332
It will be improve when PR merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants