You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/08/13 01:58:12 UTC

[GitHub] [netbeans] mbien opened a new pull request, #4501: org.netbeans.modules.java.hints.bugs.Unused doesn't cancel properly

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

   based on delivery for the slim chance that this gets a review
   
    - streams are not very good at canceling
    - by using a plain loop we can simply break out of it
    - further: `findUnused` is actually very fast, `convertUnused` is the slow part and wasn't cancelable before, the original code might have worked if `findUnused` returned a stream instead of a list and everything would be one pipeline (this would make the fix more complicated)
   
   issue:
   
    - a synthetic file with 10k fields pins a thread for about 20s
      at 100%
    - most editor features don't work during that time, e.g completion
    - hint is enabled by default
   
   
   discussion:
   
   noticed this while benchmarking other issues (#4500)
   
   #3886 mentioned the poor performance of `org.netbeans.modules.java.hints.bugs.Unused` and also that it isn't cancelable.
   #4204 attempted to fix some of it, however I am not so sure that this worked.
   
   test:
   [FieldsOfJoy10k_Unused_hint.java.txt](https://github.com/apache/netbeans/files/9330547/FieldsOfJoy10k_Unused_hint.java.txt)
   
   scroll down to:
   ```java
       // hints -> probable bugs -> unused element
       // org.netbeans.modules.java.hints.bugs.Unused#unused
       private void something() {
           this.     // code change triggers hint and pins cpu to 100%,
                     // this blocks completion etc. does cancel work?
       }
   ```
   
   `Unused#convertUnused `/ `JavaFixUtilities#safelyRemoveFromParent` use most of the time and they were not cancelable.
   
   ![unused_element_hint_baseline](https://user-images.githubusercontent.com/114367/184464074-4f512a59-fcef-46b2-802d-246871a97e1a.png)
   
   


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] neilcsmith-net merged pull request #4501: org.netbeans.modules.java.hints.bugs.Unused doesn't cancel properly

Posted by GitBox <gi...@apache.org>.
neilcsmith-net merged PR #4501:
URL: https://github.com/apache/netbeans/pull/4501


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] mbien commented on pull request #4501: org.netbeans.modules.java.hints.bugs.Unused doesn't cancel properly

Posted by GitBox <gi...@apache.org>.
mbien commented on PR #4501:
URL: https://github.com/apache/netbeans/pull/4501#issuecomment-1214159145

   @jlahoda thanks for review on such short notice!


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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