Trying to solve noticeable autocomplete slowdown in Luau LSP #847
Unanswered
JohnnyMorganz
asked this question in
Q&A
Replies: 2 comments
-
I'll check what's happening here. |
Beta Was this translation helpful? Give feedback.
0 replies
-
We should have a work-around for this issue in the next release. For the current version, situation can be improved by lowering the value of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Users of Luau LSP report a noticable autocompletion delay for the following code, specifically when the return type
: boolean
is explicitly stated (JohnnyMorganz/luau-lsp#304):Diving deeper, I find that the slowdown is in the autocomplete's
checkTypeCorrectKind
, specifically on myInstance
global (it takes 1.04128s to return in release mode)Looking into the unifier, it seems to come from the following code:
Particularly, the
normalizer->isInhabited(subTy)
call, wheresubTy
is the Instance global (andsuperTy
is the Boolean primitive type).Is there anything I can do to improve this situation?
For reference, the
Instance
global is defined as https://github.com/JohnnyMorganz/luau-lsp/blob/d5ccc835fcdccc1d25f71bc51f324b423383a806/scripts/globalTypes.d.lua#L9703-L9705, and the only extra processing I do is attaching a magic function to it (https://github.com/JohnnyMorganz/luau-lsp/blob/d5ccc835fcdccc1d25f71bc51f324b423383a806/src/LuauExt.cpp#L462-L471 and https://github.com/JohnnyMorganz/luau-lsp/blob/d5ccc835fcdccc1d25f71bc51f324b423383a806/src/LuauExt.cpp#L279-L290)I assume the problem is the significant amount of function overloads for
Instance.new
Beta Was this translation helpful? Give feedback.
All reactions