vessels: project label candidates with the camera read once per pass

The label pass projects every vessel in view each time it runs. It asked
Cesium for each one, which reads the camera and allocates for every point.
createWindowProjector reads the camera's matrices and the canvas size once
and runs the same arithmetic in the same order, so the window positions are
the same numbers (a test compares them bit for bit with Cesium); outside a
3D perspective view it asks Cesium as before.

Grid cells are keyed by number, a cell's candidate is made only for its
first vessel and updated in place, and whether a name is worth a card is
kept per vessel until its name, MMSI or id changes.

Measured in the browser (perf harness, 9,000 vessels, 1 min/s): the label
pass 33 ms -> 11 ms, the forced visibility pass 42 ms -> 27 ms.
This commit is contained in:
Sameh Khamis committed 2026-11-15 16:13:28 -08:00
1 parent 663b56f620
commit b65bb86db3
4 files changed
+239 -14

No files matched your search

+3
View File
@@ -1734,6 +1734,7 @@
"src/layers/vessels/policy.js",
"src/layers/vessels/queries.js",
"src/layers/vessels/rendering.js",
"src/data/windowProjection.js",
"src/layers/vessels/selection.js",
"src/layers/vessels/state.js",
"src/layers/vessels/testing.js",
@@ -3038,6 +3039,7 @@
"src/layers/vessels/policy.js",
"src/layers/vessels/queries.js",
"src/layers/vessels/rendering.js",
"src/data/windowProjection.js",
"src/layers/vessels/selection.js",
"src/layers/vessels/state.js",
"src/layers/vessels/testing.js",
@@ -4232,6 +4234,7 @@
"src/layers/vessels/policy.js",
"src/layers/vessels/queries.js",
"src/layers/vessels/rendering.js",
"src/data/windowProjection.js",
"src/layers/vessels/selection.js",
"src/layers/vessels/state.js",
"src/layers/vessels/testing.js",