Skip to content

Performance issue with Label (num characters) and CLAMP_TO_GROUND #12719

@alarkbentley

Description

@alarkbentley

What happened?

Adding entities in Cesium.js using HeightReference = CLAMP_TO_GROUND is generally very costly for performance. The problem seems worse with Labels than Billboards, and strangely enough the performance decreases with not only the number of entities but primarily the length of the text labels (number of characters).

Rendering 1000 labels with 5 characters works quite well. But if I increase the number of characters to 20 or 100 the application becomes unusable. This only an issue when HeightReference is used to clamp the entities to underlying terrain.

As the letters are not individually placed relative to ground I see no reason why the number of characters should effect performance here.

Reproduction steps

  1. Make sure "Clamp to Ground" is active
  2. Enable "1000 Entities" (should work fine, 60fps)
  3. Enable "100 Characters" (unusable, browser hangs)

Image

Sandcastle example

https://sandcastle.cesium.com/#c=rVdtb+M2DP4rQj45uEyx/O5cW6xI012wXlo02Q1DUxSKrSTaObYhy+2yof99lPzSJO31eusKFLYfkXxIShSZKEsLie45e2ACHaOUPaAhK3i5wV80Zsw7kf4eZqmkPGVi3umhf+YpQpIJAcigUZhV33gpss3vmUjiGjC6vXn62P04TyNNVkQsZcBVkWL9CYvNckwlhVX6QLlERvVYMhmtwZW1lHkx6PdTtqFUbGmKV1yuywXmWZ/mvL+homA8SdhdnvEC/1lk6bzT7eoXo6tJEibRmvHVWl6zJRMsjZQvdQif9hfw8OL089Xd7PLul+vL3yZnHyt1lkouOStAj5g1Bv+QDwW5mmZZppHkWYqSjMajWsHoVplTChxElTLSAeNlJkYUYjS4ZJsuOj6pJBHiS2SA8MkTa7dZUn+CyVKkHyvgsXpUecyzgmsP2uiGVEh4o6mt9+iMrQQDpzDGihQ3ClWelKF6hxpmTOPYaLl5PEBaj8e9BmtMtEBCFywZ7DoMx+YvOUDzDp13sGA5o9Kok9ft7Ygd7NHgENiVjXlBFwk7Y7lcz1ghz3ghqVaalJsFRHB1OR3Pxl9Gd+PJ+Xgynv3Ratcp08dTR/Xhg37TwOPTqVSpULt7o0OJgYSnVIU6QDeOZ4e+HeLQsr3QCTynhxw7dD0bO04QuG7gu6GCHMe2fRw4lmkFlmXfaidiLlhUG/rJxAGsBCaxQq0ZWj0EoBmGNrFsy/TBvunaPWRix1NSxCUO0FpOZazMwQqsAaXp+PAgru9axFMKph2Yoe9Ynum7ygdtJQh83yeeb9mBF1geUWYe6/o+DNLx3NDEFhDbnm+DZw744rqYED90Lds1AxWkB3IE265jEtfyvBeD9C3HDy1iuZ4XBCQIqyC9wLdM4oEzPrjo2xr1IAs2CRzfhCVwcidOvUoC4vi27dp26HheZcgnsCNWaDo2sQkJVZw+JNVyAy8MzdA03SrO2/1KXSbbWWaoja4rbPeCwhHdMAF1qoXq87yXoZ2r86nQtDm8I3dj3vaeYeQFzLptyiETHCpQo+iplNqUotepG7En4hYhz5AnUkjx64bLvLUIr+TpFWzUNVWbiktRp8isEUYLnq7O68S3DWS0B+OL8WR0en03uZyMevslOaVpHNFCJkxdSbMsSxZUfGZpadzUnam6YoYJ3eRIZugXkZVpDJ1LrUI9swQCHiBabNMItQfAaG/WdzQIfevt3fnVfaILa8+7SZayZy69xxmVqe94cFtd7m9NIDFRY+XtyTtsj2/PCDHfzffDhK8wfpfL/H+z7aLhmgoaqV749vD3J4+3x26Z76SzfnxzXyF8lYr8h1QLVsCYdfzc8OFUI9gmu2enSaLtPVZNoe0FBVxzCt9rBjFblKvpOns4F9AWiismpgzmhBjopCirafaeCrQGd5LDwXoawdiVTnMasdE9ePGpEjKaPgOahWKslTGEMU7zUp7qMIw2niy9YEs5THj01VARbMBWmzvFLugWmPfa14rJK5C/pttWZW/ua1QBa1VXSbZgOFc0YLFXoY2wmo4yyHaSrYw9pkOr3xRsu893Jcu82fBvpXK2zRm+GJ3P7oYX4+Gvc22z0+scFXKbsJNm6PuZb/JMSFSKBKbfPgyxeUKhu/UXZfSVSRwVRePMUX9X9Sjm9zD4Hr/wowhFCS0KWFmWSTLlf8PVfnLUB/lnquoIQ5+7vGcioVsltiYnFxUIs/hRHz5f1pTV1XFg+V8

Environment

Browser: Google Chrome Version 138.0.7204.97 (Official Build) (64-bit)
CesiumJS Version: 1.131
Operating System: Windows 11

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions