Skip to content

Draw mode: slow response time when adding points #79

@zworkb

Description

@zworkb

Problem

After implementing auto-handle computation (#71), clicking to add a point in Draw mode has a noticeable delay before the point appears. The more points on the path, the slower it gets.

Likely Cause

compute_handles() is called after every click, which iterates ALL control points and calls azalt_to_radec() / radec_to_azalt() for the overlay refresh. The astropy coordinate conversion is expensive (~50ms per point).

Possible Fixes

  1. Only recompute handles for affected points — when adding a point at the end, only recompute handles for the last 3 points (prev, new, and prev-prev), not the entire path
  2. Cache coordinate conversions — the overlay refresh converts all RA/Dec → Az/Alt every time, even for points that haven't moved
  3. Debounce the overlay refresh — batch multiple updates
  4. Profile first — add timing logs to identify the actual bottleneck

Related

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions