MVTDataProvider decodes & meshes tiles synchronously on the main thread (no Worker) — freezes large layers
What happened?
MVTDataProvider.createContent decodes and meshes each tile synchronously on the main thread: it calls decodeMVT(arrayBuffer) followed by buildVectorGltfFromMVT(...), and neither uses a TaskProcessor / Web Worker (confirmed in @cesium/[email protected] / CesiumJS 1.142, and still the case on main).
When a layer enters view and many tiles become visible at once, every tile's PBF decode + geometry triangulation + glTF build runs in a single blocking burst, freezing the UI thread for seconds on dense / large-extent layers. The eager runtime tile-tree build over the extent compounds this for wide-area layers.
Expected: MVT decode/meshing offloaded to a worker (the way glTF / 3D Tiles content loading is), or at least incremental/throttled tile content creation, so the main thread stays responsive.
Actual: multi-second main-thread stalls / tab freeze when a batch of MVT tiles is created in one frame.
Note: the class is tagged @experimental, so this is intended as feedback toward production-viability rather than a regression report. Our workaround was to fall back to viewport-streamed entities + clustering for large layers.
Reproduction steps
- Create a provider for a large layer:
const provider = await Cesium.MVTDataProvider.fromUrl(url, { minZoom, maxZoom, extent })for a nationwide point/line layer (tens of thousands of features). - Add
provider.tilesettoscene.primitivesand fly to the extent. - Pan / zoom so a batch of tiles enters the view at once.
- Observe a multi-second main-thread stall (unresponsive UI) while the tiles decode + mesh.
Sandcastle example
N/A — reproduced in an application; happy to provide a Sandcastle if it would help.
Environment
Browser: Chrome (latest)
CesiumJS Version: 1.142 (@cesium/[email protected]); also present on main
Operating System: macOS
AI acknowledgment
- I used AI to generate this issue report.
- (If above checked) I have reviewed the AI-generated content before submitting.
Source: CesiumGS/cesium