joelday / papyrus-lang

📜Advanced language tools for the Papyrus scripting language.
Other
112 stars 19 forks source link

Completion Extremely Slow #170

Open slacksystem opened 1 year ago

slacksystem commented 1 year ago

Describe the bug The completion functionality takes at least ten seconds and the errors seem to only track the symbols at a speed of like one letter per second

To Reproduce Start typing code and either wait for completion or press Ctrl-Space

I tried the pre-release version as well and had the same issue. It's certainly possible it's an issue with my config or something, especially since I didn't see this issue already posted, but I would like to figure out how to use the extension's functionality regardless. If there's any other information I could provide that would help diagnose I'm happy to do so

EDIT: I also looked at my task manager during a completion and saw the process DarkId.Papyrus.Host.Skyrim.exe using about 15% of my Intel i7-9700K CPU @ 3.60GHz. Dunno if that's normal or not but I figured extra info can't hurt

BellCubeDev commented 1 year ago

I've experienced the same issue, but only under certain circumstances. The main driver seems to be the size of the script at hand and the random read speed of the drive the scripts are on.

slacksystem commented 1 year ago

Hmm I don't know about my random read speed, but this is a hefty script with a few includes. Is it just too large to use completion? Or is this a bug that is fixable. I understand every tool has its limits I just don't know what's feasible and what isn't.

joelday commented 1 year ago

It's difficult to know why it's particularly bad because there are limitations on what profiling code I can add. We can probably narrow it down to individual files, at least. I suppose it could involve how many different files you've looked at in a session. I'll look into it because it shouldn't be that terrible.

slacksystem commented 1 year ago

Ok let me know what if anything I can do to help

nikitalita commented 1 year ago

At the absolute minimum, we're going to need the full project you're developing. Please give us a link or upload it somewhere.

slacksystem commented 1 year ago

Here is the most recent project I've been working on that I had the issue. It's pretty big and so is UIExtensions, the import

https://github.com/slacksystem/where-are-you

slacksystem commented 1 year ago

Also happened with this fairly basic project. Inside one of the events I tried to add Debug. and hit Ctrl-Space for completions and it took 20-ish seconds for them to come up.

skyler3d commented 1 year ago

I've observed this too. With a two line script, but any script has it happen.

skyler3d commented 1 year ago

@slacksystem are you running the CK out of MO2 by chance? I tried running it in MO2, its slow as heck. Ran it outside of MO2 and the autocomplete runs like a top.

slacksystem commented 1 year ago

@slacksystem are you running the CK out of MO2 by chance? I tried running it in MO2, its slow as heck. Ran it outside of MO2 and the autocomplete runs like a top. I may have been I'm not sure, I haven't really modded skyrim in a while. This is reminding me I should probably check on my mods on nexus. Thank you very much for the suggestion though!

skyler3d commented 1 year ago

@joelday have you tried it using MO2 out of curiosity?

joelday commented 1 year ago

@skyler3d I haven't, but we're working on integrating a different compiler right now, which will greatly improve performance, so, the only area to attempt to address this will be replaced soon anyway.