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

Improve performance of code actions, and certain delegate commands #2803

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

snjeza
Copy link
Contributor

@snjeza snjeza commented Aug 19, 2023

// see https://github.com/eclipse-jdtls/eclipse.jdt.ls/issues/2799
// Handle the paste event synchronously in the main thread
if (IDelegateCommandHandler.JAVA_EDIT_HANDLE_PASTE_EVENT.equals(params.getCommand())) {
Object result = commandHandler.executeCommand(params, new NullProgressMonitor());
Copy link
Contributor

@rgrunber rgrunber Aug 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is your thinking here that it's pointless to report progress on the paste event ? I kind of agree. I know we don't currently report progress to the client for delegates via progress support but we may implement it in the future.

@snjeza
Copy link
Contributor Author

snjeza commented Aug 21, 2023

@rgrunber I have updated the PR.

Copy link
Contributor

@rgrunber rgrunber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inspecting this in VisualVM I see :

image

After the threads are able to acquire the lock, they each hit the monitor.isCancelled() and it ends there. This is probably better than having them all run.

Can you modify the commit message to :

Improve performance of code actions, and certain delegate commands

- Handle paste event & smart semicolon detection synchronously (main thread)
- Permit only a single code action to be handled at once

- Handle paste event & smart semicolon detection synchronously (main thread)
- Permit only a single code action to be handled at once
A related issue - eclipse-jdtls#2799

Signed-off-by: Snjezana Peco <[email protected]>
@snjeza
Copy link
Contributor Author

snjeza commented Aug 21, 2023

Can you modify the commit message to :

I have modified it.

@rgrunber rgrunber changed the title Optimize Java LS performance Improve performance of code actions, and certain delegate commands Aug 22, 2023
@rgrunber rgrunber merged commit a01129c into eclipse-jdtls:master Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CPU 800% Copy-paste takes too long in WSL 【1s ~ 5min】
2 participants