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

Perf: support sending JDWP commands asynchronously #436

Merged
merged 2 commits into from
Aug 31, 2022

Conversation

testforstephen
Copy link
Contributor

This PR provides some experimental performance tuning for remote debugging:

  • Add a thread cache to reduce JDWP frequency for thread info. threads request is the most frequent DAP request, and adding a cache can save lots of unnecessary JDWP queries.
  • Provide async mode to process JDWP commands in parallel. This hopes to improve the DAP responsiveness on high-latency networks.

@testforstephen
Copy link
Contributor Author

testforstephen commented Aug 30, 2022

Here is the DAP response speed comparison when using Java debugger to attach debug a remote application.

Application: spring-petclinic (https://github.com/spring-projects/spring-petclinic)
Total threads on breakpoint: 20
Total stacks on breakpoint: 98
Local variables: 5

Sample 1: Base network latency for a JDWP command is 95ms

DAP Request Response (ms) on @0.43.0 @next (without async) @next (async)
initialize 4 1 0
attach 547 591 592
setBreakpoints 1906 1863 295 (6X)
setExceptionBreakpoints 7 1 0
configurationDone 194 194 251
threads 4349 2208 (2X) 471 (9X)
threads 4311 96 (45X) 96 (45X)
stackTrace 8943 6380 (1.4X) 1781 (5X)
scopes 4 0 0
variables 9914 11795 674 (15X)
next 2685 770 (3X) 577 (4.5X)
threads 4320 106 (40X) 95 (45X)
stackTrace 387 194 (2X) 192 (2X)
scopes 1 0 0
variables 1551 1545 389 (4X)
continue 2710 194 (14X) 190 (14X)
disconnect 99 98 96

Sample 2: Base network latency for a JDWP command is 284 ms

DAP Request Response (ms) on @0.43.0 @next (without async) @next (async)
initialize 3 0 3
attach 1619 1726 1911
setBreakpoints 5571 5450 870 (6X)
setExceptionBreakpoints 4 0 6
configurationDone 576 568 1103
threads 13090 6565 (2X) 1475 (9X)
threads 12979 282 (46X) 288 (46X)
stackTrace 26620 18744 (1.4X) 5355 (5X)
scopes 6 0 3
variables 29134 34947 2035 (14X)
next 7488 2280 (3X) 1730 (4X)
threads 12922 286 (45X) 287 (45X)
stackTrace 1152 568 (2X) 576 (2X)
scopes 0 0 0
variables 4604 4543 1150 (4X)
continue 8038 559 (14X) 579 (14X)
disconnect 288 288 287

@testforstephen testforstephen marked this pull request as ready for review August 30, 2022 07:26
@testforstephen testforstephen merged commit 9ce0aef into microsoft:main Aug 31, 2022
@testforstephen testforstephen deleted the jinbo_perf branch August 31, 2022 04:15
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.

2 participants