dfinity / vscode-motoko

Motoko language support for VS Code.
Apache License 2.0
42 stars 15 forks source link

performance improvements #173

Open letmejustputthishere opened 1 year ago

letmejustputthishere commented 1 year ago

currently with complex projects it takes a couple of seconds until the extension is up to date. e.g. when I type : Text to specify the type of a function argument, i can hover the text with my cursor and watch the progress of the tool with the info text updating like unbound type T unbound type Te unbound type Tex

letmejustputthishere commented 1 year ago

can this be improved? i autosave every 500ms (in case that has an effect)

rvanasa commented 1 year ago

Does this still happen when autosave is turned off? This looks like a bug with the type checking debounce logic (rather than purely a performance issue), so it'll be helpful to know whether this is related to autosaving.

AleDema commented 1 year ago

I have this issue too and autosave is turned off, not sure if it could be caused by wsl2.

letmejustputthishere commented 1 year ago

turning off autosave didn't help :/ i'm on macos and use the latest version of the plugin

rvanasa commented 1 year ago

Thanks for checking. Are there any public projects which I could use to fully recreate the issue on my end?

For some context, large projects with > 100 files used to take over a minute to fully type-check (comparable to large Rust projects in VS Code). Something on the order of 1-2 seconds is currently expected for projects with large numbers of files and dependencies. This can be further improved in the future, and hopefully the recent round of optimizations makes the extension a lot more usable for large projects in the immediate term.

letmejustputthishere commented 1 year ago

Yes, you can check this https://github.com/flowerpowerdao/power-equalizer

rvanasa commented 1 year ago

Thanks! I will increase the priority of further optimizations (currently representing DFINITY at ETHDenver, so I'll most likely take another look at this after March 5). If anyone reading this is at the convention, definitely come say hi! :)

rvanasa commented 1 year ago

Version 0.13.11 of the extension includes several bugfixes and improvements to address this issue. I'll leave this issue open for a bit; if you notice a difference (or lack thereof) in the smoothness of the type checker, definitely let me know so I can determine whether to prioritize another round of optimizations. :)