Change tracking causes high cpu usage
We have a small tree. ~30 nodes in total. I noticed the page was starting to get sluggish and Chrome's internal task manager said it was using 93% CPU. I ran the profiler in chrome to see what JS was causing problems and saw that the detect changes process is running quite often.
At first I thought I was doing something, but after spending 2 days combing over the code base, I am fairly certain I am not. My use case is this.
-
load the tree on page load. Each child node looks like { modelId: nodeId, name: nodeName, path: nodePage }
-
I listen to the
onActivateevent from the tree and use that to get the path from the nodes data. I then fetch a URL and that is it.nodeActivated(){ let selectedPath = $event.node.data.path; this.modelService.getRules(selectedPath).subscribe(res=>this.currentRules = res); }
Once the tree is loaded, I am not modifying the nodes. Is there a way I can turn off the change detection so I can verify if my assumption is correct?
edit I know NG2 has the ChangeDetectionStrategry I could use. I guess I am wondering If the tree has some kind of built in mechanism I can override
(originally using 3.4.0, but still persists after upgrading to 3.6.0)

Hey,
Can you check if it improves substantially when using enableProdMode()? Just so I know how grave this problem is.
One of my intentions down the road is to supply 2 different modules - one that is based on OnPush strategy, which is good for immutable / observable data, and one that is based on Default strategy, which is good for data binding.
I get the same behavior
Are there any news about the OnPush Edition of this component?
I think having 2 modules will make the maintenance too complicated. You can always wrap the tree with an onPush component