You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/05/03 10:56:47 UTC

[GitHub] ranxiangfu commented on issue #7047: 在Angular应用中使用echart,会持续占用cpu

ranxiangfu commented on issue #7047: 在Angular应用中使用echart,会持续占用cpu
URL: https://github.com/apache/incubator-echarts/issues/7047#issuecomment-386258104
 
 
   @hpyou @Ovilia 我遇到的问题和题主的是一样的,通过runOutsideAngular是可以让AnimationFrame避开Angular的脏检查,但是当切换到其他页面的时候,上一个页面的requestAnimationFrame还是一直在执行。
   
   - 验证方式:
   
   首先打开有图表的某个页面,通过ngDoCheck()可以发现requestAnimationFrame触发了脏检查:控制台一直在打印。当我切换到一个很简单的页面(没有任何动画和图表),却发现ngDoCheck()依然被一直触发,通过内存分析也可以看到requestAnimationFrame在一直执行,我觉得这是有问题的。
   而且当我某个页面绘制的echarts图表有一个比较复杂的动画时,只要打开过这个页面,访问整个整个项目的任何页面都变得CPU特别高,因为requestAnimationFrame一直在执行。
   
   我觉得这是有问题的,requestAnimationFrame不应该被一直执行。
   
   - 我的项目环境是Angular5.0和echarts3.8.5

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org