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

java server refreshing the workspace (cleaning and building) for each restart #1948

Merged
merged 1 commit into from
Nov 24, 2021

Conversation

snjeza
Copy link
Contributor

@snjeza snjeza commented Nov 23, 2021

}
}.schedule();
@Override
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, why do we need a clean build here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the JDT settings has been changed.

@testforstephen
Copy link
Contributor

Just have a try on VS Code with eclipse.jdt.ls project itself.

Without the PR:
reloading eclipse.jdt.ls on VS Code took about 5 minutes to be thumb up.

With the PR:
reloading eclipse.jdt.ls on VS Code took about 3 minutes and 18 seconds to be thumb up.

Looks like it improves the performance of project reimport.

@snjeza
Copy link
Contributor Author

snjeza commented Nov 24, 2021

@snjeza
Copy link
Contributor Author

snjeza commented Nov 24, 2021

It takes a few seconds to reload the eclipse.jdt.ls with the PR on Fedora 34.

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.

I think this is worth getting in, given how much it improves re-opening a project. I occasionally still see the build happening on a simple re-opening of the project, but the "clean workspace" job is eliminated, so it seems worth it for that.

@snjeza snjeza merged commit f90a015 into eclipse-jdtls:master Nov 24, 2021
@snjeza snjeza deleted the issue-2222 branch November 24, 2021 20:08
@rgrunber rgrunber added this to the Mid November milestone Nov 25, 2021
@testforstephen
Copy link
Contributor

I tried on macOS. It spent much time on updating project, definitely there is still room to optimize the reload performance.

image

When you tried eclipse.jdt.ls on Linux, did you install vscode-pde extension? Without it, eclipse.jdt.ls project actually won't load successfully.

@snjeza
Copy link
Contributor Author

snjeza commented Nov 25, 2021

When you tried eclipse.jdt.ls on Linux, did you install vscode-pde extension?

No, I didn't. I will check. Could you, please, test a maven/gradle/eclipse project?

@snjeza
Copy link
Contributor Author

snjeza commented Nov 25, 2021

reloading eclipse.jdt.ls on VS Code took about 3 minutes and 18 seconds to be thumb up.

This is an upstream vscode-pde issue. I have created testforstephen/vscode-pde#37
You can speed up reloading eclipse.jdt.ls by adding the following property:

"java.jdt.ls.vmargs": "-Declipse.jdt.ls.skipGradleChecksums=true ..."

@testforstephen
Copy link
Contributor

https:/eclipse/eclipse.jdt.ls/blob/282c35026d50c253572e60b17a55715e7f9cae2f/org.eclipse.jdt.ls.core/pom.xml#L34-L51

I saw we added a m2e tag <?m2e execute onConfiguration?> for this task, this looks like unnecessary because this task should only be used by CI jobs, not needed by the IDE m2e tools.

@snjeza
Copy link
Contributor Author

snjeza commented Nov 26, 2021

I saw we added a m2e tag for this task, this looks like unnecessary because this task should only be used by CI jobs, not needed by the IDE m2e tools.

You are right. Could you, please, create a new issue and PR?

@testforstephen
Copy link
Contributor

Try commenting out the m2e tag, and the reimport performance will drop to about 1 minutes.

I'll push a fix after the 1.1.0 version is released.

@snjeza
Copy link
Contributor Author

snjeza commented Dec 3, 2021

I tried on macOS. It spent much time on updating project, definitely there is still room to optimize the reload performance.
When you tried eclipse.jdt.ls on Linux, did you install vscode-pde extension? Without it, eclipse.jdt.ls project actually won't load successfully.

@testforstephen could you, please, test https:/snjeza/vscode-test/raw/master/java-1.2.3.vsix

@testforstephen
Copy link
Contributor

Try your java-1.2.4.vsix with -Djava.ls.doNotSetDefaultJVM=true on eclipse.jdt.ls, updating project configuration is a littler faster than before. I will find some time to review your PR implementation.

@snjeza
Copy link
Contributor Author

snjeza commented Dec 6, 2021

@testforstephen java-1.2.4.vsix with -Djava.ls.doNotSetDefaultJVM=true takes a few seconds to reload the eclipse.jdt.ls on Fedora 34 and Windows 10.
Could you, please, attach your server log (java.trace.server: messages)?

reload

@testforstephen
Copy link
Contributor

I'm on macOS. Here is the log.
log.txt

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.

java server refreshing the workspace (cleaning and building) for each restart which is taking a lot of time
4 participants