Hi, whenever I load a Cesium viewer on a browser (Firefox, Brave, Safari) the fans of my iMac go crazy which seems to indicate an intensive use of resources. I use this code to create entities:
viewer.entities.add({…}). Currently I have 50k entities but planning to have even more. Is there any “limit” to the number of entities which can exist in a Cesium viewer at any point of time? Do I need to do some clean up somewhere also when I exit the browser? Thanks
There’s no particular limit built into Cesium. The limiting factors are typically CPU, memory, and graphics hardware. What’s your configuration? What graphics are being displayed for your entities? Does Activity Monitor show anything “interesting”?
Hi, thanks for the reply. My config is iMac 27 inch (2017-Retina 5K) with Big Sur, 24 GB RAM, Graphic Radeon Pro 580 8 GB. Processor: 4.2 GHz Quad-Core Intel Core i7.
I am just adding “points” on the globe (see code below). Activity Monitor shows me high CPU usage it seems. See screenshots taken for Brave, Safari and Firefox (see screenshots). Hope this helps. Thanks. C
viewer.entities.add({
id : cityDetail.id,
position: Cesium.Cartesian3.fromDegrees(parseFloat(cityDetail.city_lon), parseFloat(cityDetail.city_lat)),
point: {
pixelSize: sizeToUse,
scaleByDistance: new Cesium.NearFarScalar(1.5e2, 1.5, 1.5e7, 0.7), //scaling by viewer distance
color: colorToUse
}});
My Dell Precision 7510 laptop with NVIDIA M1000M runs one logical processor at 100% which does seem like a lot. But given that an Entity is considered dynamic, Cesium needs to inspect each entity for changes frequently (not exactly sure how frequently). I believe that this is what I’m seeing. I’m using the Geonames cities5000 data for my testing (based on what you’ve described) converted to GeoJSON.
If your data is likewise static, you might consider providing it via a OGC Web Map Service using GeoServer or MapServer. In the future publishing the data as 3DTiles will be possible when vector data is supported.
Hope that helps.
Yeah, as soon as you’ve got lots of entities or data on the map you should look into primitives and rendering tricks to control them yourself. There’s several guides on this, but for these points;
Cheers,
Alex
Thank you both @Scott_Reynolds & @Alexander_Johannesen