Link only the stars that are drawn

The jump-link graph linked the whole catalogue: 3.7 million links at 8 pc, 7.4-7.8 s in the
worker and a 443-515 ms frame on the main thread when they landed, and most of them between stars
that were neither drawn nor clickable. A graph request now carries the star field's drawn stars,
and the worker links only those, over an index of its own with cells as wide as the range. The
scene asks again once a new drawn set has held still for 250 ms.

The renderer is handed the graph's bounding sphere instead of computing it: three.js walked every
vertex on the main thread in the first frame that drew a new graph, 48-55 ms at 8 pc.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016jxMkwA2rbicdGxHosecYi
This commit is contained in:
2026-09-17 16:16:38 +02:00
co-authored by Claude Opus 5
parent 96348161cc
commit c6206a8311
11 changed files with 225 additions and 49 deletions
@@ -306,6 +306,14 @@ export class StarFieldRenderer {
return this.drawn.length;
}
/**
* The catalogue indices being drawn. Replaced by a refocus that changes them, never changed in
* place, so the same array means the same stars.
*/
get drawnStars(): Uint32Array {
return this.drawn;
}
/**
* Chooses the drawn stars again for where the view now is, and rewrites the instance buffers
* with them. See {@link selectDrawnStars}.