lahodaj opened a new pull request, #7708:
URL: https://github.com/apache/netbeans/pull/7708

   @jtulach reported the code completion inside VS Code is sometimes slow for 
him. I was thinking of that, and experimenting, and I think at least part of 
the problem is that tasks that should be background tasks are not properly 
cancellable in the VS Code (Java) server.
   
   I was doing experiments on:
   
https://github.com/openjdk/jdk/blob/master/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
   
   and it seemed there were three particular pain points:
   - the `documentSymbol`, which I attempted to tackle in 
https://github.com/apache/netbeans/pull/7707
   - diagnostics (especially hints) computation, which can take a fairly long 
time to compute
   - semantic coloring computation, which can also take some time to compute
   
   Neither of these can be cancelled when the request to compute code 
completion. This draft is attempting to improve that, and run diagnostics and 
semantic coloring in a cancellable way.
   
   It only properly cancels for Java sources at this time, for other sources 
runs only the CompletableFuture cancel will work. Some work on Schedulers will 
be needed to fully enable this for non-Java sources.
   
   This PR is primarily for experimentation/validation that it helps, but 
feedback is welcome nonetheless.
   
   I also have a separate/independent commit that adds additional logging for 
code completion, namely:
   - logs time the CC took,
   - and if it takes more 1 second, it will print a thread dump, and start self 
sampler.
   
   The self sampler ran out of heap for me when running without 
https://github.com/apache/netbeans/pull/7707, so I would suggest to either use 
this additional logging with `LspElementUtils` fixed, or disable the self 
sampler part.
   
   The additional logging commit is:
   
https://github.com/lahodaj/netbeans/commit/e3d5b2fc0e09c2f6571798bde3acd06388cec01e
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to