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

    - optimizes the `isUnusedInPkg()` code path
    - one pkg private element comes rarely alone, getting the `ClassIndex` for 
the `FileObject` can be expensive
    - compute it only once
   
   running a synthetic [test 
file](https://github.com/mbien/nb-reprorepo/blob/54003b76bc25116e2f563940836709f02d125b19/performance/classes/src/main/java/test/classes/InnerClasses10k.java#L3)
 with 10k package private elements
   
   `findUnused()` without caching (in ms):
   ```
   time: 8289
   time: 9288
   ```
   
   `ClassIndex` computed once:
   ```
   time: 262
   time: 1818
   ```
   note: the method is called twice on first file open, both measurements are 
shown since the code paths are different.
   
   This might be potentially solvable without putting anything into the cache 
and making `UnusedDetector` an instance object.


-- 
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-unsubscr...@netbeans.apache.org

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


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

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

Reply via email to