POTENTIAL BUG: PrimitiveCollection.Remove() slower on Linux compared to Windows

1. A concise explanation of the problem you're experiencing.

I create a primitive that is composed of tens of thousands of Geometry Instances. Removing this primitive using the "remove()" function seems to take significantly longer on Linux compared to Windows.

On Windows, using Chrome browser: ~12 ms
On Linux, using Chromium browser: ~4500 ms

Are there any known performance issues with primitives.remove() on Linux? Does anyone have a workaround (i.e another way to get rid of primitives that might be quicker)?

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

At the bottom is a link to a sandcastle example which constructs a massive random shape composed of tens of thousands of triangles. It places these triangles into a Primitive.

I have added a callback to the example which removes the primitive when you click anywhere on the map, and prints the amount of time taken by "remove()" to the console.

Try the below example, click anywhere on the map to see the primitive get removed. Then look at the console to see how much time it took (try it on Linux and Windows).

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I am using lots of triangle geometry instances to create colored surface plots of different shapes. The below example shows a nonsensical shape with garbage data, but I use this same approach for more complex shapes, which results in greater performance disparities.

4. The Cesium version you're using, your operating system and browser.

Reproduced the issue with Cesium 1.50, on Windows w/ Chrome, and Linux w/ Chromium.

LINK TO SANDCASTLE EXAMPLE:

Wow, that’s a huge difference. Something weird must be going on.

Were you able to test this with Chromium on Windows as well, using the same version, just to double check that it’s not a recent bug on their side?

If so, please open a bug on https://github.com/AnalyticalGraphicsInc/cesium/issues with the same info and Sandcastle you have there. This is definitely something we’d want to investigate further.

I just found this old reported issue:

https://github.com/AnalyticalGraphicsInc/cesium/issues/3018

I wonder if it’s related. Might give you some more ideas to try.

Hi Omar,
Thanks for taking a look, that link definitely looks related. However, I'm hesitant to try out the workarounds in it.

I have created a new issue, as I'm not 100% sure if it's the same issue: https://github.com/AnalyticalGraphicsInc/cesium/issues/7230

Thanks again,
Abhi