Rendering polygons using entity api makes cpu usage high

hi,
i am using entity api for rendering multi polygons with data more than 30 mb.
after rendering cpu usage goes to 100% .

please let me know if there is any solution to this.

i have also tried explicit rendering by following

requestRenderMode: true,
maximumRenderTimeChange : Infinity,

below is sample code for adding polygons and polylines

this.viewer.entities.add({

      id: 2,

      name: "anyname",

      description: description,

      polygon: {

        hierarchy: Cesium.Cartesian3.fromDegreesArray(positions),

        material: Cesium.Color.fromCssColorString(color).withAlpha(alpha),

        outline: true,

        outlineColor: Cesium.Color.fromCssColorString(polygonOutlineColor),

        outlineWidth: width,

        fill: true,

        height: 0

      },

      polyline: {

        width: width,

        positions: Cesium.Cartesian3.fromDegreesArray(positions),

        material: Cesium.Color.fromCssColorString(polygonOutlineColor).withAlpha(1)

      },

      label: {

        text: entityName,

        font: '14pt monospace',

        style: Cesium.LabelStyle.FILL_AND_OUTLINE,

        outlineWidth: 2,

        verticalOrigin: Cesium.VerticalOrigin.BOTTOM,

        pixelOffset: new Cesium.Cartesian2(0, -9)

      }

    });

Can you tell us a little about your application, presentation environment and the nature of the data? Do you need to draw all of the data all of the time? Can a user really see all of the data at its finest level of detail at all times? What’s the user’s hardware/OS? Answering these questions can lead to better advice.

user should be able to see one country data at a distance of 100km
and some sample coordinates are like below.

this data is coming in a single shot from server. this data is actually a kml file data and we have to show whole kml file data to user

why translucencybydistance is not available with entity api . or is there a way or any alternate to use it with polygons with entity api

If the scene you’ve shown is representative of the way the data is going to be viewed, I’d suggest that, if possible, the level of detail be reduced when the KML is generated. When I view a similar (33 MB) KML file (data downloaded from [here](https://data.humdata.org/dataset/honduras-admin-level-1-boundaries and saved as KML using QGIS) I’m seeing about 6% CPU usage on my 4 core laptop with NVIDIA Quadro M1000M graphics.

What does WebGLReport.com show about your environment? Here’s mine:

Platform: Win32
Browser User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36
Context Name: webgl
GL Version: WebGL 1.0 (OpenGL ES 2.0 Chromium)
Shading Language Version: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)
Vendor: WebKit
Renderer: WebKit WebGL
Unmasked Vendor: Google Inc.
Unmasked Renderer: ANGLE (NVIDIA Quadro M1000M Direct3D11 vs_5_0 ps_5_0)
Antialiasing: Available
ANGLE: Yes, D3D9
Major Performance Caveat: No

here is environment detail below

Platform: Win32
Browser User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36
Context Name: webgl
GL Version: WebGL 1.0 (OpenGL ES 2.0 Chromium)
Shading Language Version: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)
Vendor: WebKit
Renderer: WebKit WebGL
Unmasked Vendor: Google Inc.
Unmasked Renderer: ANGLE (Intel® UHD Graphics 630 Direct3D11 vs_5_0 ps_5_0)
Antialiasing: Available
ANGLE: Yes, D3D11
Major Performance Caveat: No

have you tried importing file in cesium through kmldatasource?

please check this example. kml file and see cpu usage

The performance information I gave was for loading the KML file I generated into Sandcastle. I’m seeing similar, maybe slightly better, results when I switch to the MS Edge browser that is using my Intel UHD Graphics 530. The driver version is reported as 26.20.100.6888. Windows has 16 GB of RAM.

Performance is consistently under 2% CPU using MS Edge on the 530 for your Sandcastle example.

https://we.tl/t-dqWIGqFi5H pls download and try this file.

also i am attaching screenshot of cpu usage on my pc.