Details
Description
SeqPanel.mouseMoved (gui or applet) computes the tooltip for every mouse event. At moderate or slow mouse speeds, this repeatedly recomputes the tooltip for the same residue, unnecessarily.
This can be shown with a simple sysout debug statement.
(At high mouse speeds, this doesn't arise, as events/positions are skipped by the processing thread.)
This is a potentially expensive and poorly scalable operation, as it involves scanning all the sequence features to find those at the position, checking visibility (for feature / feature group / score), as well as building the actual text. The worst case would be genomic sequence with a large number of features.
(Having said that, I found that findFeaturesAtRes() takes <4ms to scan 10K features.)
gui code checks whether the tooltip is the same as the previous one before setting it.
applet code just sets it.
mouseMoved() also calls mouseOverSequence() (which checks whether sequence/column have changed before broadcasting).
mouseMoved() in gui also sets the status bar message (every time),
This would be more efficient if it checked first whether the sequence/column has changed, if not do nothing.
Note also applet mouseMoved doesn't call setStatusMessage() or SequenceAnnotationReport, potential to remove code duplication here.
This can be shown with a simple sysout debug statement.
(At high mouse speeds, this doesn't arise, as events/positions are skipped by the processing thread.)
This is a potentially expensive and poorly scalable operation, as it involves scanning all the sequence features to find those at the position, checking visibility (for feature / feature group / score), as well as building the actual text. The worst case would be genomic sequence with a large number of features.
(Having said that, I found that findFeaturesAtRes() takes <4ms to scan 10K features.)
gui code checks whether the tooltip is the same as the previous one before setting it.
applet code just sets it.
mouseMoved() also calls mouseOverSequence() (which checks whether sequence/column have changed before broadcasting).
mouseMoved() in gui also sets the status bar message (every time),
This would be more efficient if it checked first whether the sequence/column has changed, if not do nothing.
Note also applet mouseMoved doesn't call setStatusMessage() or SequenceAnnotationReport, potential to remove code duplication here.
Attachments
Issue Links
- related with
-
JAL-2526 SequenceCursor for more efficient Sequence.findPosition, findIndex
- Closed