-
Notifications
You must be signed in to change notification settings - Fork 399
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
completion performance: calculating constantValue is expensive #1835
Comments
Confirmed. A good chunk of the time generating the completion items is spent exactly as shown above. The completion description, hovering over the value seems like a better place for this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When code completion suggests constant fields, it will resolve their values directly and display them in the label section. See the screenshot.
It turns out this is an expensive operation. Especially when a type contains many constant fields, resolving them all during code completion will significantly reduce performance. See the profiling result, resolving constant value for the fields of
org.eclipse.jdt.internal.compiler.ast.ASTNode
will cost 45% CPU time of the language server.And if I set the CompletionHandler.completion as the call tree root, you can see that resolving constant field will cost more than 90% CPU time of the completion handler.
Suggestion: We can remove the constant value from the label part so as to avoid the expensive calculations. But keep its value in javadoc in case the user wants to see its value.
The text was updated successfully, but these errors were encountered: