question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Very slow performance with 'Svelte for VS Code' extension on Sapper projects on networked drives

See original GitHub issue

After trying the extension on a fresh project & seeing how fast it is, I’d like to reach out for some assistance in figuring out why the language server takes 6-7 seconds on every edit to HTML to begin serving language features again on Sapper projects on a networked drive.

Setting debug trace to “verbose” produces this series of messages when typing the below snippet and expecting IDE features:

https://user-images.githubusercontent.com/5150427/113370742-e16aaa80-9321-11eb-9830-29eaf9058b4e.mp4

[Trace - 7:19:58 PM] Sending notification 'textDocument/didChange' ("<").
[Trace - 7:19:58 PM] Sending request 'textDocument/completion - (5)'.
[Trace - 7:19:58 PM] Sending request 'textDocument/signatureHelp - (6)'.
[Trace - 7:19:58 PM] Sending notification 'textDocument/didChange' ("B").
[Trace - 7:19:58 PM] Sending notification '$/cancelRequest' - (6).
[Trace - 7:19:58 PM] Sending request 'textDocument/signatureHelp - (7)'.
[Trace - 7:19:58 PM] Sending request 'textDocument/semanticTokens/full - (8)'.
[Trace - 7:19:58 PM] Sending notification 'textDocument/didChange' ("u").
[Trace - 7:19:58 PM] Sending notification 'textDocument/didChange' ("t").
[Trace - 7:19:58 PM] Sending notification '$/cancelRequest' - (7).
[Trace - 7:19:58 PM] Sending request 'textDocument/signatureHelp - (9)'.
[Trace - 7:19:58 PM] Sending notification 'textDocument/didChange' ("t").
[Trace - 7:19:58 PM] Sending notification 'textDocument/didChange' ("t").
[Trace - 7:19:58 PM] Sending notification '$/cancelRequest' - (9).
[Trace - 7:19:58 PM] Sending request 'textDocument/signatureHelp - (10)'.
[Trace - 7:19:58 PM] Sending notification 'textDocument/didChange' ("o").
[Trace - 7:19:59 PM] Sending notification '$/cancelRequest' - (10).
[Trace - 7:19:59 PM] Sending request 'textDocument/signatureHelp - (11)'.
[Trace - 7:19:59 PM] Sending request 'textDocument/documentColor - (12)'.
[Trace - 7:19:59 PM] Sending request 'textDocument/codeAction - (13)'.
[Trace - 7:20:02 PM] Sending notification '$/cancelRequest' - (5).
[Trace - 7:20:03 PM] Received response 'textDocument/completion - (5)' in 5839ms.
Using Svelte v3.32.3 from ~\Frontend\node_modules\svelte\compiler
Using Svelte v3.32.3 from ~\Frontend\node_modules\svelte\compiler
[Trace - 7:20:03 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:20:03 PM] Received response 'textDocument/signatureHelp - (6)' in 5775ms.
[Trace - 7:20:04 PM] Sending request 'textDocument/codeAction - (14)'.
[Trace - 7:20:04 PM] Sending notification '$/cancelRequest' - (13).
[Trace - 7:20:09 PM] Received response 'textDocument/signatureHelp - (7)' in 11269ms.
Using Svelte v3.32.3 from ~\Frontend\node_modules\svelte\compiler
Using Svelte v3.32.3 from ~\Frontend\node_modules\svelte\compiler
[Trace - 7:20:09 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 7:20:09 PM] Received response 'textDocument/semanticTokens/full - (8)' in 11304ms.
[Trace - 7:20:09 PM] Received response 'textDocument/signatureHelp - (9)' in 11076ms.
[Trace - 7:20:09 PM] Received response 'textDocument/signatureHelp - (10)' in 10879ms.
[Trace - 7:20:09 PM] Received response 'textDocument/signatureHelp - (11)' in 10716ms.
[Trace - 7:20:09 PM] Received response 'textDocument/documentColor - (12)' in 10669ms.
[Trace - 7:20:09 PM] Received response 'textDocument/codeAction - (13)' in 10594ms.
[Trace - 7:20:09 PM] Received response 'textDocument/codeAction - (14)' in 5515ms.

Trying the clean Svelte template and Sapper webpack template in different environments with trace on yields these results:

Local drive - Svelte template: 22ms
Network drive - Svelte template: 34ms
Local drive - Sapper Webpack: 307ms
Network Drive - Sapper Webpack: 6002ms

There didn’t seem to be much difference with/without Typescript or with/without sveltestrap.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Roryl-ccommented, Dec 20, 2021

Apologies for the long delay. There does seem to be a considerable improvement. It’s still slow, but I understand there’s only so much that can be done about that over a networked drive and for this reason I’ve switched to remote windows with VSCode which has vastly improved my development experience. Svelte language features are quite snappy over the remote window.

I think I can consider this solved though, the delay now seems to be about 2 seconds instead of 6-7+. Thanks for your efforts!

1reaction
dummdidummcommented, Sep 13, 2021

The latest version of svelte-preprocess does cache the resolved tsconfig files. Previously, they were loaded for each file, which might be slow on networked drives because IO operations could be slower. Could you try and report back if the situation improved?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is Your VS Code Extension Slow? Here's How to Speed it Up!
I went through the steps in the VS Code docs to update my project to use WebPack. My goals were to make all...
Read more >
Getting started with Svelte - Learn web development | MDN
Svelte is a compiler that generates minimal and highly optimized JavaScript code from our sources; you'll need a terminal with node + npm ......
Read more >
Learn Svelte Framework: Build a Portfolio Website with SvelteKit
It's a newer framework that replaces Sapper. It is the fastest way to build svelte apps with beautiful development experiences and flexible filesystem-based ......
Read more >
All About Svelte, the Much-Loved, State-Driven Web Framework
Here's everything you need to know to get started with Svelte, a relatively young, open source web UI framework for defining a web...
Read more >
An early look at SvelteKit | InfoWorld
SvelteKit is the successor to Sapper, the full-stack, server-side prerendering application framework for Svelte, similar to Next.js for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found