CesiumGS / CesiumGS/cesium

Performance regression in Entity billboards when using Resource instances

Open
#7,840 1 comment 0 reactions 0 assignees View on GitHub
category - billboards category - entity type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

If `BillboardGraphics.image` is set to a `Resource` instance, then we end up creating a new clone of the instance every frame, this is most likely a major performance bottleneck in certain use cases.

https://github.com/AnalyticalGraphicsInc/cesium/blob/bd3c32398f8a3d95a9436ddf733ad4793063de9c/Source/DataSources/BillboardVisualizer.js#L115

Since `BillboardGraphics.image` can be a Uri, Resource, Canvas, or Image, it only makes sense to Clone the result if it's a Resource, but you don't really know that until you get the value. It probably not too much work to figure out a decent fit, but we should also track down other possible performance issues like this in the entity layer due to the Resource refactor.

Contributor guide

Open the contributing guide

Research direction

Start at Source/DataSources/BillboardVisualizer.js around line 115 and trace how BillboardGraphics.image values are handled when they are Resource instances. Profile or inspect the Entity billboard update path to confirm whether a Resource is cloned every frame, then determine whether related Entity-layer performance issues are in scope. Done means eliminating the unnecessary per-frame Resource clone without changing support for Uri, Canvas, or Image values.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.