Frame Rate Drop/Performance issues when Adding a KMLDataSource

I'm attempting to move my company from Google Earth to Cesium and I'm 95% there. I'm facing one last major problem that I've been, thus far, unable to fix.

We use some larger KMLs with ~5000 Placemarks containing a point with custom icons. While I can load the data alright, when I do there is a stark drop in frame rate to 0FPS for seconds at a time.

This wouldn't be an issue except for the fact there is a constant FlyTo around the globe and this lag causes the fly to freeze then skip locations, which looks awful.

I'm trying to either shorten the lag time or find a way to add the DataSource without the lag in the process. Any ideas?

Here is how I'm loading the KmlDataSource:

Hi Benjamin,

I’m confused as to why you are removing data sources, but I may be missing something. It doesn’t seem necessary to me, and may be causing additional lag.

If I was just in dataSources, this is what I would do:

Cesium.KmlDataSource.load(kml_url, {
canvas: viewer.scene.canvas
}).then(function(dataSource) {

kmlSources[name] = dataSource;



For a good explanation of what may be causing some performance errors when loading in KML files, take a look at this thread.

Thanks, hope that helps!


It is mostly reloading. The KML that I'm loading is rewritten every 20 minutes or so and I need to update my information in Cesium when that change occurs. With this, I and removing the old KML Data and adding the new current data in.

I have read through that thread before, though I don't think it pertains to my situation as the memory requirements of loading our KML files isn't large at all, and therefore Cesium will do it easily.

Oh, I see. Perhaps you can update each entity by it’s id rather than loading the entire KML in and out each refresh? That way you shouldn’t get a huge lag as you load in the whole KML file, and only update the relevant properties like position.

Here’s an overview of the Entity API if you need it.



Also instead of removing the old and loading in a new KML, maybe look into the update function.