JDK-8092447 : Optimize picking performance
  • Type: Sub-task
  • Component: javafx
  • Sub-Component: scenegraph
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2009-08-24
  • Updated: 2015-06-12
  • Resolved: 2013-05-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Fixed
Related Reports
Blocks :  
Duplicate :  
Relates :  
Description
There are various picking optimizations we could do:

1. Remove use of HashMap / HashSet (or convert to LinkedHashSet)
    - Should just be able to reuse a single ArrayList, no object generation

2. Use PickRay everywhere
    - Make extremely lightweight, reuse PickRay to avoid object generation when picking

3. Need an "on read" hook for variables such as "hovered" (note that this needs compiler support).
    - Needed to have optimization where we pick less of the scene if nobody is listening
    - Not sure how this plays with event bubbling where we might not know if somebody needs the event

Comments
The original points were: 1. Remove use of HashMap/HashSets: there are no maps or sets since the time we switched to the capturing/bubbling mechanism 2. Use PickRay everywhere: PickRay is used everywhere and is reused as much as possible 3. Need an "on read" hook for variables such as "hovered": with the settable event dispatchers it is impossible to tell whether or not somebody needs the event I've kept this open only because of Jim's comment, but I've decided to mark it fixed and file a separate follow-up issue: RT-30603.
23-05-2013

Following optimizations pushed with changeset 897ef4f2b18e: * Single PickRay instance reused during the whole picking * No temporary parent-to-local transformations created (unless a complex inversion is needed) * Performing simple deltaTransform on vectors instead of adding, transforming and subtracting points * Fast path for pick rays perpendicular to the XY plane
13-02-2013

Moving to Lombard (parent issue is already targeted to Lombard).
29-08-2011

From the work on doing the gradients in 3D we know that the pick can be expressed as a linear transform, but currently the code implements it as a sequence of vector operations that include a linear transform as only one stage of the entire picking operation. We should figure out how to boil the sequence of operations into a single transform for efficiency. This will especially help the cases of the clipping code in Decora and the 3D setup code for the gradients - both of which use multiple "pick" operations at the corners of the clip rectangle to map it backwards through the rendering scene.
30-03-2011

This bug should be evaluated along with other picking related issue as an overall clean up into the picking algorithm. Push to Critical priority.
22-10-2009

This issue is a super set RT-3781
04-09-2009