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
- 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
- Cache coordinate conversions — the overlay refresh converts all RA/Dec → Az/Alt every time, even for points that haven't moved
- Debounce the overlay refresh — batch multiple updates
- Profile first — add timing logs to identify the actual bottleneck
Related
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 callsazalt_to_radec()/radec_to_azalt()for the overlay refresh. The astropy coordinate conversion is expensive (~50ms per point).Possible Fixes
Related