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

Copy-paste takes too long in WSL 【1s ~ 5min】 #3199

Closed
mozhuanzuojing opened this issue Jul 13, 2023 · 12 comments · Fixed by eclipse-jdtls/eclipse.jdt.ls#2803
Closed

Copy-paste takes too long in WSL 【1s ~ 5min】 #3199

mozhuanzuojing opened this issue Jul 13, 2023 · 12 comments · Fixed by eclipse-jdtls/eclipse.jdt.ls#2803

Comments

@mozhuanzuojing
Copy link

mozhuanzuojing commented Jul 13, 2023

[provide a description of the issue]
In the new class in WSL, i often need to wait 5 seconds to more than 5 minutes for copy-paste operations. Particularly affects work.

Environment
  • Operating System: Win11
  • Remote Operating System: Ubuntu22.04
  • JDK version: 17
  • Visual Studio Code version: 1.81.0
  • Java extension version: 1.20.0 ~ 1.21.0
Steps To Reproduce
  1. Create a new class and copy and paste it multiple times

Current Result

copy and paste wait 1s ~ 5min

Expected Result

Copy and paste is done in 1 second

Additional Informations

The work plan for the past few days is not finished, SOS

@benzman81
Copy link

same here

@mozhuanzuojing
Copy link
Author

Quick Fix... Sometimes it's slow.

here is stack

Ctrl + 1 辅助stack1.txt

@mozhuanzuojing
Copy link
Author

@mozhuanzuojing
Copy link
Author

do you need jfr?

@and-y
Copy link

and-y commented Aug 9, 2023

Have the same problem with the latest version 1.21.0.
With the version 1.18.0 copy/paste is fast as expected.

@mozhuanzuojing
Copy link
Author

Ctrl + 1 [jfr] .zip

@mozhuanzuojing
Copy link
Author

copy & paste [jfr] .zip

@mozhuanzuojing
Copy link
Author

mozhuanzuojing commented Aug 14, 2023

@nickzhums
Copy link
Contributor

@testforstephen @jdneo any idea for this issue? @mozhuanzuojing is one of our dedicated user from the past, and it seems like several users have ran into this problem.

@testforstephen
Copy link
Collaborator

Quick Fix... Sometimes it's slow.

here is stack

Ctrl + 1 辅助stack1.txt

After a look at the callstack, the code action of Introduce parameter uses up all the available threads from the common ThreadPool that is shared by delegate command. This causes the paste command java.edit.handlePasteEvent to be delayed and slow to respond. This seems to be the same issue as reported in eclipse-jdtls/eclipse.jdt.ls#2799.

To mitigate this issue, I can think of two possible solutions:

  • Handle the paste event synchronously in the main thread, instead of asynchronously with a thread pool. This would avoid the competition for threads. (This is similar to how the code completion works.)
  • Optimize the performance of the code action for Introduce parameter, so that it does not consume too many threads or take too long to execute.

@fbricon
Copy link
Collaborator

fbricon commented Aug 17, 2023

You can disable vscode-java's special paste handling with:

"[java]": {
   "editor.pasteAs.enabled": false
},

@mozhuanzuojing
Copy link
Author

You can disable vscode-java's special paste handling with:

"[java]": {
   "editor.pasteAs.enabled": false
},

thanks,i will try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants