Atlaslog / Field Notes / 3D & Cesium
Field note · 3D & Cesium
Frame rate drops to 18 with two thousand entities
Quick answer
500 stations stay smooth, while 2000 drag at 18 to 22 FPS. Entity properties are re-evaluated every frame, over 20000 evaluations at that count, and each Label rebuilds its own texture atlas.
Symptom
- scene.debugShowFramesPerSecond shows 18 FPS.
- The profile shows EntityCluster and Property.getValue taking over 20 ms per frame while draw calls stay low.
- viewer.entities.values.length is 2000.
Checklist
- Comment out the Label and keep only Billboard to see whether labels or icons are the cost.
- Read viewer.entities.values.length to confirm entities were not added twice.
- Check viewer.scene.primitives.length, which should not grow by one per station.
- Check whether each entity gets its own ConstantProperty that could be shared.
Fix
Replace the entities with one BillboardCollection using collection.add with position, image, scale 0.8 and verticalOrigin BOTTOM, plus one LabelCollection, so 2000 points become a single primitive and a single draw call. If entities must stay, pass a plain Cartesian3 instead of a Property and keep only interactive key sites as entities.
Code
viewer.scene.debugShowFramesPerSecond = true;
// 左上角显示 18 FPSconsole.log('实体数量', viewer.entities.values.length);
console.log('图元数量', viewer.scene.primitives.length);
Watch out
- Adding a Label per station and expecting billboards to fix the cost, since each label is its own texture.
- Keeping CallbackProperty positions for static stations, forcing per-frame evaluation of data that never changes.
English edition written for Atlaslog from the original Chinese field note. Code is unchanged and runs as-is.
Atlaslog (2026). Frame rate drops to 18 with two thousand entities. https://www.jingweizhi.com/en/cookbook/cesium-entity-drop-frame.html (accessed 2026-11-03).