How to restrict Polyline Sample-Points? Getting Bad Performance

Hi everyone,

In my application, I need to show path of the moving points.

Number of moving points: ~1000 (loading through CZML)

Each point has the following path attributes:

  • trailTime: 60 (A Property specifying the number of seconds in front of the object to show. Source: Cesium Documentation)

  • resolution: 60 (A numeric Property specifying the maximum number of seconds to step when sampling the position. Source: Cesium Documentation)

I am getting around 30 FPS when PATH is disabled and around 4 FPS with the enabled PATH.

Can anyone please explain the relationship between trailTime and resolution?

I think that the problem is that polyline has to draw many sample-points which reduces the performance but if I can restrict it to draw just few sample-points then I may not get smooth curves but that will result in good performance.

My second thought is that it might be the memory issue. Because the point is moving and I only want to see path for last 60 seconds, so data structure which is holding this array of points to render the path/polyline is re-allocating the memory for the updated set of points every frame/second. If that is the issue then may be I need to modify it so that it uses may a fixed size array and don’t re-allocate memory again and again and just add/remove points in/from the same fixed size array?

Or may be my thinking is completely wrong… Can anyone share some thoughts on this?