Uploaded image for project: 'Jalview'
  1. Jalview
  2. JAL-2290

Avoid repeated calculation of unchanged sequence tooltip

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.10.0
    • Fix Version/s: 2.10.3
    • Component/s: jvdesktop, jvlite
    • Labels:
      None

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gmungoc Mungo Carstairs
              Reporter:
              gmungoc Mungo Carstairs
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: