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

Slow Performance (Intellisense primarily) #362

Closed
wampxs opened this issue Jul 9, 2023 · 16 comments
Closed

Slow Performance (Intellisense primarily) #362

wampxs opened this issue Jul 9, 2023 · 16 comments
Labels
bug Something isn't working

Comments

@wampxs
Copy link

wampxs commented Jul 9, 2023

Type: Bug

The Ren'Py VSCode addon has been faulty for a while now, since the last major update (the one that changed some text colors, I believe.)

The biggest harm I've felt is the now-unusably slow IntelliSense autocomplete results, which is lamentable. That is a feature I use constantly, and it's hampering my work-flow.

It also has an "Unresponsive" warning on the 'Running Extensions' window.

Extension version: 2.2.2/2.3.6 (both seem to have the same issue)
VS Code version: Code 1.80.0 (660393deaaa6d1996740ff4880f1bad43768c814, 2023-07-04T15:06:02.407Z)
OS version: Windows_NT x64 10.0.19044

CPU is a Ryzen 7 3800x.

@duckdoom4
Copy link
Collaborator

duckdoom4 commented Jul 9, 2023

That's unfortunate. To figure out the exact cause we'll need some help though. If it's taking a long time to complete an action in your project, it's likely that some part of your codebase triggers a bug in the extension.
I've not ran into performance issues in my test projects.

We'll need a cpu profile session from your project to see what part of the code is causing the performance bottleneck. You can find how to creat one on this page:

https://github.com/microsoft/vscode/wiki/Explain-extension-causes-high-cpu-load

@wampxs
Copy link
Author

wampxs commented Jul 9, 2023

Is this it?

CPU-20230709T141159.cpuprofile.txt

@duckdoom4
Copy link
Collaborator

duckdoom4 commented Jul 9, 2023

No sorry, I should have specified. If you follow the gif, they use the load function of the profiler. But that's what we need to do on our end.

If you could do the same steps as shown in the gif, but choose the option to make a new profile.

When you start a session, vscode will record what the code is doing, so make sure you do the actions that will trigger the slowdown.

Then you can stop the session and upload the results. We should then be able to see the parts of the code that take a long time in your project

@wampxs
Copy link
Author

wampxs commented Jul 9, 2023

I actually did that.
Started recording, then tried auto-completing one variable (which gave me the expected slowdown), then stopped once it found the variable name.

The file I sent was the cpuprofile log generated from that.
Just remove the '.txt', Github doesn't allow uploading the .cpuprofile format for some reason. That should let you load it on the profiler
(I tested it myself, though I have no clue what the results mean 😪)

@duckdoom4
Copy link
Collaborator

duckdoom4 commented Jul 10, 2023

Hmm, well the profile you've uploaded doesn't go through any of our source code. It only mentionedworkbench.desktop.main.js.

Are you sure it is our plugin and not something else?

And/or are you sure you triggered the slowdown while you made the cpu profile?

See if starting vscode with --disable-extensions makes a difference.

The old issue here might give you some other things to try: microsoft/vscode#159004

@wampxs
Copy link
Author

wampxs commented Jul 10, 2023

Huh... The file I sent was a different kind of recording then. That was straight from the devtools (probably the JS Profiler).
Just tried recording from the "Running Extensions" window instead, see if this one shows anything relevant.

CPU-20230710T073226.348Z.cpuprofile.txt

@duckdoom4
Copy link
Collaborator

That one does show different information. I'll have a look after work

@wampxs
Copy link
Author

wampxs commented Jul 12, 2023

Seems like rolling back to 2.0.16 fixed the slowness issues. Very likely to be a 2.2.x thing.
Not only do Intellisense results show up instantly, but saving times are faster too. These were very sluggish in the newer update.

@duckdoom4
Copy link
Collaborator

Hm, yes alright. That's enough proof then. I'll try to see if I can find the issue/what I can do about it.

@duckdoom4 duckdoom4 added the bug Something isn't working label Jul 12, 2023
@Kant8
Copy link

Kant8 commented Jul 15, 2023

For me it's constantly hangs on "Initializing Ren'Py static data" right after vscode startup. Can sit like that for half an hour easily. And vscode complains about "very slow last operation" from extension.
Even search for files doesn't work properly until that intialization ends.

No problems if extension is disabled.

@duckdoom4
Copy link
Collaborator

duckdoom4 commented Jul 15, 2023

For me it's constantly hangs on "Initializing Ren'Py static data" right after vscode startup. Can sit like that for half an hour easily. And vscode complains about "very slow last operation" from extension.
Even search for files doesn't work properly until that intialization ends.

No problems if extension is disabled.

Ah yes, I was hoping that issue would be fixed with the latest update, but clearly not.

Would you be able to figure out what file exactly is causing the issue? It should be one (or more) specific files in your project.

If you'd be able to share it with me (privately if necessary), then I can debug the issue and fix it.

@quocmanh94
Copy link

quocmanh94 commented Aug 1, 2023

I met the same problem when I was starting VSC. Please help me check.
exthost-13f03d.cpuprofile.txt

@lust-reborn
Copy link

lust-reborn commented Aug 11, 2023

Same issue on v2.2.2 and pre-release v2.3.6

vscode complains about "very slow last operation" from extension. Even search for files doesn't work properly until that intialization ends.

extension causes all other extensions to fail. they just hang after "intilization"

No problems if extension is disabled.

ditto

Edit: Attaching my cpu profile, unsure of which is the right one-- sorry I'm extremely new at all this.

LuqueDaniel.languague-renpy-unresponsive.cpuprofile.txt
exthost-407ebd.cpuprofile.txt

@DeltaGe
Copy link

DeltaGe commented Nov 19, 2023

Yep, I can confirm, the extension does not work, stuck on loading renpy static data, and until it is uninstalled it disables intellisense entirely

@brainos233
Copy link

Still exists in 2.4.0

@duckdoom4
Copy link
Collaborator

duckdoom4 commented Aug 15, 2024

I've made it 10x faster, so it shouldn't be a problem with slowness anymore. There could still be the issue of it getting stuck though, but we already have #437 for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants