covalent icon indicating copy to clipboard operation
covalent copied to clipboard

CPU usage is high when set dynamic data

Open duxy2002 opened this issue 4 years ago • 3 comments

Do you want to request a feature or report a bug?

report a bug.

Feature Request

Bug Report

when we set dynamic data to line chart every 3 second, CPU usage is about 90%...

Which version of Angular and Material, and which browser and OS does this issue affect?

"@angular/animations": "7.2.12",
"@angular/cdk": "7.3.7",
"@angular/common": "7.2.12",
"@angular/compiler": "7.2.12",
"@angular/core": "7.2.12",
"@angular/forms": "7.2.12",
"@angular/http": "7.2.12",
"@angular/material": "7.3.7",

chrome: 75.0.3770.142 OS: mac 10.14.2 (18C54)

duxy2002 avatar Jul 31 '19 03:07 duxy2002

Hi @duxy2002,

It would help the debugging process a lot if you can provide us a stackblitz demo so we can reproduce it on our end.

Can you send us a .gif of your dynamic data line chart demo & activity monitor display w/ the cpu activity displayed?

What are the specs of your box this demo is running on?

ghost avatar Jul 31 '19 17:07 ghost

HI @stevenov7

Sorry。My mistake. I use interval() of [email protected] to set data every 3 seconds. But I figure out that there was a wrong way to use interval(), that caused setting data dynamically every one second...

BTW, I found there is a conflict with angular change detection and echarts. https://github.com/apache/incubator-echarts/issues/7047. I modified chart.component.ts as below and improve performance even if setting data dynamically every one second. image

duxy2002 avatar Aug 02 '19 03:08 duxy2002

Something to take into account for beta.2, would be nice to improve performance.

emoralesb05 avatar Oct 05 '19 01:10 emoralesb05