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:
@@ -79,12 +79,17 @@ export class StarNeighbourhood {
|
||||
});
|
||||
}
|
||||
|
||||
/** The star this id names, or `undefined` — the caller's id may not be in the catalogue. */
|
||||
/** Where the star this id names sits in the list the index was built from, or `undefined`. */
|
||||
indexOf(id: number): number | undefined {
|
||||
return this.indexById.get(id);
|
||||
}
|
||||
|
||||
/** The star at this position in the list the index was built from. */
|
||||
pointAt(index: number): StarPoint {
|
||||
return this.points[index];
|
||||
}
|
||||
|
||||
/** The star this id names, or `undefined` — the caller's id may not be in the catalogue. */
|
||||
point(id: number): StarPoint | undefined {
|
||||
const index = this.indexById.get(id);
|
||||
return index === undefined ? undefined : this.points[index];
|
||||
|
||||
Reference in New Issue
Block a user