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

Make the debounce time of publish diagnostic job adaptive #2443

Merged
merged 2 commits into from
Feb 10, 2023

Conversation

jdneo
Copy link
Contributor

@jdneo jdneo commented Feb 8, 2023

Now the debounce time of publish diagnostic jobs are adaptive. Ranging from [400, 2000] ms.

Signed-off-by: Sheng Chen sheche@microsoft.com

How to test the impact of this change:

  1. Add lombok dependency to petclinic project.
  2. Toggle on the setting java.trace.server to messages, which will let the client print all the response time in the output channel.
  3. Use this attached file to replace PetControllerTests.
  4. Launch the language server.

    Remember to add the lombok agent to the launch file when debugging.

  5. After the projects are imported and no more output can be observed in the output channel, clear the output channel.

    The project import traces are not related with this change, so we filter them out.

  6. In the last method void testProcessUpdateFormHasErrors26(), do some modification to trigger different kinds of LSP requests. When I test it locally, I typed System.out.println(); and then use Backspace to remove the typed characters one by one.
  7. Wait until no more output can be observed, then we can analysis the average time cost to process each of the request. For example, copy the output to a file and scan it line by line. Regular Expression like /\[Trace.*\] Received response \'.*\' in (\d+)ms/ can help us pick the time out.

Test Result

By doing the above experiment according to the above steps with and without PR, the average time cost to process a request list below:

Time(ms)
Without the change 633
With the change 325

My machine is a Windows 10 with i7-10700 2.9GHz CPU.


Looks like the change works well from the customer's feedback: redhat-developer/vscode-java#1765 (comment)

Signed-off-by: Sheng Chen <sheche@microsoft.com>
@jdneo jdneo marked this pull request as ready for review February 9, 2023 08:01
@jdneo jdneo changed the title [WIP] Make the debounce time of publish diagnostic job adaptive Make the debounce time of publish diagnostic job adaptive Feb 9, 2023
Signed-off-by: Sheng Chen <sheche@microsoft.com>
@jdneo jdneo merged commit 7fa7567 into eclipse-jdtls:master Feb 10, 2023
@jdneo jdneo deleted the cs/adaptive-debounce branch February 10, 2023 06:43
@jdneo jdneo added this to the Mid February 2023 milestone Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants